Fixtures can be rolled back (ticket #11101).
(self)
| 987 | |
| 988 | @skipUnlessDBFeature("supports_transactions") |
| 989 | def test_ticket_11101(self): |
| 990 | """Fixtures can be rolled back (ticket #11101).""" |
| 991 | with transaction.atomic(): |
| 992 | management.call_command( |
| 993 | "loaddata", |
| 994 | "thingy.json", |
| 995 | verbosity=0, |
| 996 | ) |
| 997 | self.assertEqual(Thingy.objects.count(), 1) |
| 998 | transaction.set_rollback(True) |
| 999 | self.assertEqual(Thingy.objects.count(), 0) |
| 1000 | |
| 1001 | |
| 1002 | class TestLoadFixtureFromOtherAppDirectory(TestCase): |
nothing calls this directly
no test coverage detected