summaryrefslogtreecommitdiff
path: root/tests/fixtures_regress
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-11-05 23:06:55 -0800
committerCarlton Gibson <carlton.gibson@noumenal.es>2019-11-06 08:06:55 +0100
commit92e5abd7a3dbbea88b3d43d5790f94e276bc6dff (patch)
treef54588abc71856aaaefa8fecd93648ec9cd968b4 /tests/fixtures_regress
parent89368ab6e358ebe29a0417d65209182238daa245 (diff)
downloaddjango-92e5abd7a3dbbea88b3d43d5790f94e276bc6dff.tar.gz
Refs #29983 -- Added test for FIXTURES_DIRS pathlib support.
Diffstat (limited to 'tests/fixtures_regress')
-rw-r--r--tests/fixtures_regress/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py
index 1cac151367..cc4cee3de4 100644
--- a/tests/fixtures_regress/tests.py
+++ b/tests/fixtures_regress/tests.py
@@ -3,6 +3,7 @@ import json
import os
import re
from io import StringIO
+from pathlib import Path
from django.core import management, serializers
from django.core.exceptions import ImproperlyConfigured
@@ -517,6 +518,11 @@ class TestFixtures(TestCase):
verbosity=0,
)
+ @override_settings(FIXTURE_DIRS=[Path(_cur_dir) / 'fixtures_1'])
+ def test_fixtures_dir_pathlib(self):
+ management.call_command('loaddata', 'inner/absolute.json', verbosity=0)
+ self.assertQuerysetEqual(Absolute.objects.all(), [1], transform=lambda o: o.pk)
+
class NaturalKeyFixtureTests(TestCase):