mirror of https://github.com/django/django.git
Refs #29983 -- Added test for FIXTURES_DIRS pathlib support.
This commit is contained in:
parent
89368ab6e3
commit
92e5abd7a3
|
@ -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):
|
||||
|
||||
|
|
Loading…
Reference in New Issue