Opened 9 years ago
Closed 9 years ago
#26017 closed Uncategorized (fixed)
forms_tests.tests.test_fields.FieldsTests.test_filepathfield_folders does not work when the tests directory is named differently
Reported by: | Raphaël Hertzog | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.9 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
I tried "cp -a tests ~/tmp/django-tests" and then ran the tests from ~/tmp/django-tests. It turns out you get this failure:
====================================================================== FAIL: test_filepathfield_folders (forms_tests.tests.test_fields.FieldsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/rhertzog/tmp/django-tests/forms_tests/tests/test_fields.py", line 1586, in test_filepathfield_folders self.assertTrue(got[0].endswith(exp[0])) AssertionError: False is not true
Printing got and exp before the test you see this:
(u'/home/rhertzog/tmp/django-tests/forms_tests/tests/filepath_test_files/directory', u'directory') (u'/tests/forms_tests/tests/filepath_test_files/directory', u'directory')
As you can see the difference is in the "/django-tests/" vs "/tests/" that do not match.
I would suggest that tests should not depend on the name of the top-level directory in which they are stored... it's an easy patch and I will submit it soon as PR.
Note:
See TracTickets
for help on using tickets.
Here's the pull request: https://github.com/django/django/pull/5899