diff options
author | Preston Timmons <prestontimmons@gmail.com> | 2014-06-11 10:07:33 -0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2014-06-11 11:35:33 -0400 |
commit | 68efbfde5e35013c14c0c30cabb1c94b80a48807 (patch) | |
tree | 7472be0903823cf012ed516d9b5edaf896173b1c /tests/runtests.py | |
parent | 42736ac8e8c31137131714013951249a09e6e7d4 (diff) | |
download | django-68efbfde5e35013c14c0c30cabb1c94b80a48807.tar.gz |
Fixed #22068 -- Made runtests.py remove trailing slashes from test labels.
When using tab-completion it's easy to accidentally run a test with
a trailing slash, which causes INSTALLED_APPS to be set incorrectly.
Normalize the test labels to avoid this common error.
Thanks MattBlack for the suggestion.
Diffstat (limited to 'tests/runtests.py')
-rwxr-xr-x | tests/runtests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/runtests.py b/tests/runtests.py index 61e90e3845..e828faeea8 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -340,6 +340,10 @@ if __name__ == "__main__": '--selenium', action='store_true', dest='selenium', default=False, help='Run the Selenium tests as well (if Selenium is installed)') options = parser.parse_args() + + # Allow including a trailing slash on app_labels for tab completion convenience + options.modules = [os.path.normpath(labels) for labels in options.modules] + if options.settings: os.environ['DJANGO_SETTINGS_MODULE'] = options.settings else: |