]> git.ipfire.org Git - thirdparty/patchwork.git/commit
tests: ensure we don't see database errors during duplicate insert
authorJeremy Kerr <jk@ozlabs.org>
Thu, 16 Apr 2020 01:29:25 +0000 (09:29 +0800)
committerStephen Finucane <stephen@that.guru>
Sat, 18 Apr 2020 11:55:47 +0000 (12:55 +0100)
commit9463c2b3038fd278ef1a7de4a370d40862379483
tree3b25cd40a3e8cd75c88fe74a6ee7a47a480849a9
parent1493073e38c0c57e85778d2fdbf55cdb415522ca
tests: ensure we don't see database errors during duplicate insert

Currently, the parser causes IntegrityErrors while inserting duplicate
patches; these tend to pollute database logs.

This change adds a check, which currently fails, to ensure we do not
cause errors during a duplicate patch parse.

Conflicts:
patchwork/tests/test_parser.py

NOTE(stephenfin): Conflicts are once again due to import reordering. In
addition, we have to skip these tests on Django 1.11 since the
'connection.execute_wrapper' context manager was first added in Django
2.0 [1].

[1] https://docs.djangoproject.com/en/dev/releases/2.0/#models

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stephen Finucane <stephen@that.guru>
[stephenfin: Add 'expectedFailure' marker to keep all tests green]
(cherry picked from commit a60e75e2c6897fd262ec95a35e0e94b9027c11d4)
patchwork/tests/test_parser.py