]> git.ipfire.org Git - thirdparty/patchwork.git/commit
tests: Run FuzzTest within a transaction
authorJeremy Kerr <jk@ozlabs.org>
Mon, 28 Aug 2017 11:39:17 +0000 (19:39 +0800)
committerStephen Finucane <stephen@that.guru>
Thu, 31 Aug 2017 08:44:03 +0000 (09:44 +0100)
commitddef10cfdd3e7c51d005a50f46bad0561e74662b
tree543751eabee9d6b39ecf66c4276d69693570ba48
parentdfc5758d2b0481bd2d882997c19d31b65876d799
tests: Run FuzzTest within a transaction

Currently, the FuzzTests fail for me with:

/backends/base/base.py", line 428, in validate_no_broken_transaction
    "An error occurred in the current transaction. You can't "
TransactionManagementError: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.

- because the SQL inserts can fail, during an active transaction (the
first failure I see is attempting to insert \0 chars in
codec-null.mbox); this causes the setup for the next test case to fail.

Instead, run each test in its own transaction.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit e505f1fd26224fc7dcadf43146bc1408a470fe15)
patchwork/tests/test_parser.py