MCPcopy
hub / github.com/django/django / test_ticket_11101

Method test_ticket_11101

tests/fixtures_regress/tests.py:989–999  ·  view source on GitHub ↗

Fixtures can be rolled back (ticket #11101).

(self)

Source from the content-addressed store, hash-verified

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
1002class TestLoadFixtureFromOtherAppDirectory(TestCase):

Callers

nothing calls this directly

Calls 2

set_rollbackMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected