Loading tests/fixtures/tests.py +1 −0 Original line number Diff line number Diff line Loading @@ -142,6 +142,7 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase): # Loading a fixture that doesn't exist emits a warning with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") management.call_command('loaddata', 'unknown.json', verbosity=0, commit=False) self.assertEqual(len(w), 1) Loading tests/fixtures_model_package/tests.py +4 −1 Original line number Diff line number Diff line Loading @@ -102,8 +102,11 @@ class FixtureTestCase(TestCase): ) # Load a fixture that doesn't exist with warnings.catch_warnings(record=True): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") management.call_command("loaddata", "unknown.json", verbosity=0, commit=False) self.assertEqual(len(w), 1) self.assertTrue(w[0].message, "No fixture named 'unknown' found.") self.assertQuerysetEqual( Article.objects.all(), [ Loading Loading
tests/fixtures/tests.py +1 −0 Original line number Diff line number Diff line Loading @@ -142,6 +142,7 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase): # Loading a fixture that doesn't exist emits a warning with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") management.call_command('loaddata', 'unknown.json', verbosity=0, commit=False) self.assertEqual(len(w), 1) Loading
tests/fixtures_model_package/tests.py +4 −1 Original line number Diff line number Diff line Loading @@ -102,8 +102,11 @@ class FixtureTestCase(TestCase): ) # Load a fixture that doesn't exist with warnings.catch_warnings(record=True): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") management.call_command("loaddata", "unknown.json", verbosity=0, commit=False) self.assertEqual(len(w), 1) self.assertTrue(w[0].message, "No fixture named 'unknown' found.") self.assertQuerysetEqual( Article.objects.all(), [ Loading