1
0
mirror of https://github.com/django/django.git synced 2024-12-23 09:36:06 +00:00

Fixed a test to correctly calculate a fixture's relative path.

This commit is contained in:
Julien Phalip 2014-11-17 02:32:04 +01:00
parent fab26cf5e0
commit 580e9d0045

View File

@ -898,7 +898,7 @@ class TestLoadFixtureFromOtherAppDirectory(TestCase):
# fixtures_regress depending on how runtests.py is invoked. # fixtures_regress depending on how runtests.py is invoked.
# All path separators must be / in order to be a proper regression test on # All path separators must be / in order to be a proper regression test on
# Windows, so replace as appropriate. # Windows, so replace as appropriate.
relative_prefix = current_dir.replace(os.getcwd(), '', 1)[1:].replace('\\', '/') relative_prefix = os.path.relpath(current_dir, os.getcwd()).replace('\\', '/')
fixtures = [relative_prefix + '/fixtures/absolute.json'] fixtures = [relative_prefix + '/fixtures/absolute.json']
def test_fixtures_loaded(self): def test_fixtures_loaded(self):