Refs #29983 -- Added test for FIXTURES_DIRS pathlib support.

This commit is contained in:
Jon Dufresne 2019-11-05 23:06:55 -08:00 committed by Carlton Gibson
parent 89368ab6e3
commit 92e5abd7a3
1 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import json
import os import os
import re import re
from io import StringIO from io import StringIO
from pathlib import Path
from django.core import management, serializers from django.core import management, serializers
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
@ -517,6 +518,11 @@ class TestFixtures(TestCase):
verbosity=0, 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): class NaturalKeyFixtureTests(TestCase):