From 92e5abd7a3dbbea88b3d43d5790f94e276bc6dff Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Tue, 5 Nov 2019 23:06:55 -0800 Subject: [PATCH] Refs #29983 -- Added test for FIXTURES_DIRS pathlib support. --- tests/fixtures_regress/tests.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py index 1cac151367f..cc4cee3de42 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):