diff options
Diffstat (limited to 'tests/fixtures_regress/tests.py')
-rw-r--r-- | tests/fixtures_regress/tests.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py index 8c9228f675..ff796feb94 100644 --- a/tests/fixtures_regress/tests.py +++ b/tests/fixtures_regress/tests.py @@ -569,6 +569,20 @@ class TestFixtures(TestCase): with self.assertRaisesMessage(ImproperlyConfigured, msg): management.call_command("loaddata", "absolute.json", verbosity=0) + @override_settings(FIXTURE_DIRS=[Path(_cur_dir) / "fixtures"]) + def test_fixture_dirs_with_default_fixture_path_as_pathlib(self): + """ + settings.FIXTURE_DIRS cannot contain a default fixtures directory + for application (app/fixtures) in order to avoid repeated fixture loading. + """ + msg = ( + "'%s' is a default fixture directory for the '%s' app " + "and cannot be listed in settings.FIXTURE_DIRS." + % (os.path.join(_cur_dir, "fixtures"), "fixtures_regress") + ) + with self.assertRaisesMessage(ImproperlyConfigured, msg): + management.call_command("loaddata", "absolute.json", verbosity=0) + @override_settings( FIXTURE_DIRS=[ os.path.join(_cur_dir, "fixtures_1"), |