From 33836cf88dd08ebd66d19ad7f732b12f089abd27 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Tue, 26 Feb 2013 13:19:18 +0100 Subject: [PATCH] Renamed some tests and removed references to modeltests/regressiontests. --- tests/admin_changelist/tests.py | 2 +- tests/admin_inlines/tests.py | 10 +- tests/admin_scripts/tests.py | 135 +++++++++--------- tests/admin_validation/tests.py | 2 +- tests/admin_views/tests.py | 68 ++++----- tests/admin_widgets/tests.py | 4 +- tests/cache/tests.py | 14 +- tests/commands_sql/tests.py | 2 +- .../comment_tests/custom_comments/__init__.py | 14 +- tests/comment_tests/tests/__init__.py | 18 +-- tests/comment_tests/tests/app_api_tests.py | 12 +- tests/comment_tests/tests/feed_tests.py | 2 +- .../tests/moderation_view_tests.py | 2 +- tests/conditional_processing/models.py | 2 +- tests/context_processors/tests.py | 2 +- tests/empty/no_models/tests.py | 2 +- tests/empty/tests.py | 2 +- tests/file_storage/tests.py | 2 +- tests/{forms => forms_tests}/__init__.py | 0 tests/{forms => forms_tests}/models.py | 0 .../templates/forms/article_form.html | 0 .../{forms => forms_tests}/tests/__init__.py | 0 .../tests/error_messages.py | 2 +- tests/{forms => forms_tests}/tests/extra.py | 0 tests/{forms => forms_tests}/tests/fields.py | 12 +- .../tests/filepath_test_files/.dot-file | 0 .../tests/filepath_test_files/directory/.keep | 0 .../tests/filepath_test_files/fake-image.jpg | 0 .../filepath_test_files/real-text-file.txt | 0 tests/{forms => forms_tests}/tests/forms.py | 0 .../{forms => forms_tests}/tests/formsets.py | 0 .../tests/input_formats.py | 0 tests/{forms => forms_tests}/tests/media.py | 0 tests/{forms => forms_tests}/tests/models.py | 0 .../tests/regressions.py | 4 +- tests/{forms => forms_tests}/tests/util.py | 0 .../tests/validators.py | 0 tests/{forms => forms_tests}/tests/widgets.py | 2 +- tests/{forms => forms_tests}/urls.py | 2 +- tests/{forms => forms_tests}/views.py | 0 tests/generic_inline_admin/tests.py | 10 +- tests/generic_views/base.py | 2 +- tests/generic_views/dates.py | 12 +- tests/generic_views/detail.py | 2 +- tests/generic_views/edit.py | 8 +- tests/generic_views/list.py | 2 +- tests/handlers/tests.py | 2 +- tests/i18n/patterns/tests.py | 8 +- tests/i18n/patterns/urls/default.py | 2 +- tests/i18n/patterns/urls/wrong.py | 2 +- tests/i18n/tests.py | 10 +- tests/inline_formsets/tests.py | 6 +- tests/invalid_models/tests.py | 2 +- tests/logging_tests/tests.py | 8 +- tests/mail/tests.py | 10 +- tests/middleware/tests.py | 22 +-- tests/middleware_exceptions/tests.py | 12 +- .../models.py | 2 +- .../tests.py | 6 +- tests/model_permalink/tests.py | 2 +- tests/runtests.py | 5 +- tests/servers/tests.py | 2 +- tests/special_headers/tests.py | 6 +- tests/staticfiles_tests/tests.py | 12 +- tests/swappable_models/tests.py | 2 +- tests/syndication/tests.py | 2 +- .../{templates => template_tests}/__init__.py | 0 .../alternate_urls.py | 0 .../callables.py | 0 .../{templates => template_tests}/context.py | 0 tests/{templates => template_tests}/custom.py | 0 .../eggs/tagsegg.egg | Bin .../{templates => template_tests}/filters.py | 0 .../{templates => template_tests}/loaders.py | 0 tests/{templates => template_tests}/models.py | 0 .../{templates => template_tests}/nodelist.py | 0 tests/{templates => template_tests}/parser.py | 0 .../{templates => template_tests}/response.py | 10 +- .../{templates => template_tests}/smartif.py | 0 .../templates/broken_base.html | 0 .../templates/first/test.html | 0 .../templates/inclusion.html | 0 .../templates/response.html | 0 .../templates/second/test.html | 0 .../templates/ssi include with spaces.html | 0 .../templates/ssi_include.html | 0 .../templates/test_context.html | 0 .../templates/test_extends_error.html | 0 .../templates/test_incl_tag_current_app.html | 0 .../templates/test_incl_tag_use_l10n.html | 0 .../templates/test_include_error.html | 0 .../templatetags/__init__.py | 0 .../templatetags/bad_tag.py | 0 .../templatetags/broken_tag.py | 0 .../templatetags/custom.py | 0 .../templatetags/subpackage/__init__.py | 0 .../templatetags/subpackage/echo.py | 0 .../templatetags/subpackage/echo_invalid.py | 0 tests/{templates => template_tests}/tests.py | 40 +++--- .../{templates => template_tests}/unicode.py | 0 tests/{templates => template_tests}/urls.py | 2 +- tests/{templates => template_tests}/views.py | 0 tests/{test_templates => templates}/base.html | 0 .../comments/comment_notification_email.txt | 0 .../custom_admin/add_form.html | 0 .../custom_admin/change_form.html | 0 .../custom_admin/change_list.html | 0 .../custom_admin/delete_confirmation.html | 0 .../delete_selected_confirmation.html | 0 .../custom_admin/index.html | 0 .../custom_admin/login.html | 0 .../custom_admin/logout.html | 0 .../custom_admin/object_history.html | 0 .../custom_admin/password_change_done.html | 0 .../custom_admin/password_change_form.html | 0 .../extended.html | 0 .../form_view.html | 0 .../{test_templates => templates}/login.html | 0 .../views/article_archive_day.html | 0 .../views/article_archive_month.html | 0 .../views/article_confirm_delete.html | 0 .../views/article_detail.html | 0 .../views/article_form.html | 0 .../views/article_list.html | 0 .../views/datearticle_archive_month.html | 0 .../views/urlarticle_detail.html | 0 .../views/urlarticle_form.html | 0 tests/test_client_regress/tests.py | 4 +- tests/test_runner/tests.py | 26 ++-- tests/test_utils/tests.py | 4 +- tests/timezones/tests.py | 2 +- tests/urlpatterns_reverse/erroneous_urls.py | 10 +- tests/urlpatterns_reverse/extra_urls.py | 4 +- .../included_named_urls.py | 2 +- .../included_namespace_urls.py | 6 +- tests/urlpatterns_reverse/named_urls.py | 2 +- tests/urlpatterns_reverse/namespace_urls.py | 14 +- tests/urlpatterns_reverse/tests.py | 38 ++--- tests/urlpatterns_reverse/urls.py | 4 +- .../urls_error_handlers.py | 4 +- tests/urls.py | 20 +-- tests/{utils => utils_tests}/__init__.py | 0 tests/{utils => utils_tests}/archive.py | 0 .../archives/foobar.tar | Bin .../archives/foobar.tar.bz2 | Bin .../archives/foobar.tar.gz | Bin .../archives/foobar.zip | Bin tests/{utils => utils_tests}/baseconv.py | 0 tests/{utils => utils_tests}/checksums.py | 0 tests/{utils => utils_tests}/crypto.py | 0 .../{utils => utils_tests}/datastructures.py | 0 tests/{utils => utils_tests}/dateformat.py | 0 tests/{utils => utils_tests}/dateparse.py | 0 tests/{utils => utils_tests}/datetime_safe.py | 0 tests/{utils => utils_tests}/decorators.py | 0 .../{utils => utils_tests}/eggs/test_egg.egg | Bin tests/{utils => utils_tests}/encoding.py | 0 tests/{utils => utils_tests}/feedgenerator.py | 0 tests/{utils => utils_tests}/functional.py | 0 tests/{utils => utils_tests}/html.py | 0 tests/{utils => utils_tests}/http.py | 0 tests/{utils => utils_tests}/ipv6.py | 0 tests/{utils => utils_tests}/jslex.py | 0 tests/{utils => utils_tests}/models.py | 0 .../{utils => utils_tests}/module_loading.py | 20 +-- tests/{utils => utils_tests}/numberformat.py | 0 tests/{utils => utils_tests}/os_utils.py | 0 tests/{utils => utils_tests}/regex_helper.py | 0 .../simplelazyobject.py | 0 tests/{utils => utils_tests}/termcolors.py | 0 .../test_module/__init__.py | 0 .../test_module/bad_module.py | 0 .../test_module/good_module.py | 0 .../test_no_submodule.py | 0 tests/{utils => utils_tests}/tests.py | 0 tests/{utils => utils_tests}/text.py | 0 tests/{utils => utils_tests}/timesince.py | 0 tests/{utils => utils_tests}/timezone.py | 0 tests/{utils => utils_tests}/tzinfo.py | 0 tests/{views => view_tests}/__init__.py | 0 tests/{views => view_tests}/app0/__init__.py | 0 .../app0/locale/en/LC_MESSAGES/djangojs.mo | Bin .../app0/locale/en/LC_MESSAGES/djangojs.po | 0 tests/{views => view_tests}/app1/__init__.py | 0 .../app1/locale/fr/LC_MESSAGES/djangojs.mo | Bin .../app1/locale/fr/LC_MESSAGES/djangojs.po | 0 tests/{views => view_tests}/app2/__init__.py | 0 .../app2/locale/fr/LC_MESSAGES/djangojs.mo | Bin .../app2/locale/fr/LC_MESSAGES/djangojs.po | 0 tests/{views => view_tests}/app3/__init__.py | 0 .../app3/locale/es_AR/LC_MESSAGES/djangojs.mo | Bin .../app3/locale/es_AR/LC_MESSAGES/djangojs.po | 0 tests/{views => view_tests}/app4/__init__.py | 0 .../app4/locale/es_AR/LC_MESSAGES/djangojs.mo | Bin .../app4/locale/es_AR/LC_MESSAGES/djangojs.po | 0 .../fixtures/testdata.json | 24 ++-- tests/{views => view_tests}/generic_urls.py | 6 +- .../locale/de/LC_MESSAGES/djangojs.mo | Bin .../locale/de/LC_MESSAGES/djangojs.po | 0 .../locale/es/LC_MESSAGES/djangojs.mo | Bin .../locale/es/LC_MESSAGES/djangojs.po | 0 .../locale/fr/LC_MESSAGES/djangojs.mo | Bin .../locale/fr/LC_MESSAGES/djangojs.po | 0 .../locale/ru/LC_MESSAGES/djangojs.mo | Bin .../locale/ru/LC_MESSAGES/djangojs.po | 0 tests/{views => view_tests}/media/file.txt | 0 tests/{views => view_tests}/media/file.txt.gz | Bin .../{views => view_tests}/media/file.unknown | 0 tests/{views => view_tests}/models.py | 0 .../templates/debug/render_test.html | 0 .../templates/debug/template_exception.html | 0 .../templates/jsi18n.html | 0 .../templatetags/__init__.py | 0 .../templatetags/debugtags.py | 0 tests/{views => view_tests}/tests/__init__.py | 0 tests/{views => view_tests}/tests/debug.py | 2 +- tests/{views => view_tests}/tests/defaults.py | 0 tests/{views => view_tests}/tests/i18n.py | 12 +- .../{views => view_tests}/tests/shortcuts.py | 2 +- tests/{views => view_tests}/tests/specials.py | 2 +- tests/{views => view_tests}/tests/static.py | 0 tests/{views => view_tests}/urls.py | 12 +- tests/{views => view_tests}/views.py | 0 tests/wsgi/tests.py | 12 +- 224 files changed, 384 insertions(+), 376 deletions(-) rename tests/{forms => forms_tests}/__init__.py (100%) rename tests/{forms => forms_tests}/models.py (100%) rename tests/{forms => forms_tests}/templates/forms/article_form.html (100%) rename tests/{forms => forms_tests}/tests/__init__.py (100%) rename tests/{forms => forms_tests}/tests/error_messages.py (99%) rename tests/{forms => forms_tests}/tests/extra.py (100%) rename tests/{forms => forms_tests}/tests/fields.py (99%) rename tests/{forms => forms_tests}/tests/filepath_test_files/.dot-file (100%) rename tests/{forms => forms_tests}/tests/filepath_test_files/directory/.keep (100%) rename tests/{forms => forms_tests}/tests/filepath_test_files/fake-image.jpg (100%) rename tests/{forms => forms_tests}/tests/filepath_test_files/real-text-file.txt (100%) rename tests/{forms => forms_tests}/tests/forms.py (100%) rename tests/{forms => forms_tests}/tests/formsets.py (100%) rename tests/{forms => forms_tests}/tests/input_formats.py (100%) rename tests/{forms => forms_tests}/tests/media.py (100%) rename tests/{forms => forms_tests}/tests/models.py (100%) rename tests/{forms => forms_tests}/tests/regressions.py (98%) rename tests/{forms => forms_tests}/tests/util.py (100%) rename tests/{forms => forms_tests}/tests/validators.py (100%) rename tests/{forms => forms_tests}/tests/widgets.py (99%) rename tests/{forms => forms_tests}/urls.py (64%) rename tests/{forms => forms_tests}/views.py (100%) rename tests/{templates => template_tests}/__init__.py (100%) rename tests/{templates => template_tests}/alternate_urls.py (100%) rename tests/{templates => template_tests}/callables.py (100%) rename tests/{templates => template_tests}/context.py (100%) rename tests/{templates => template_tests}/custom.py (100%) rename tests/{templates => template_tests}/eggs/tagsegg.egg (100%) rename tests/{templates => template_tests}/filters.py (100%) rename tests/{templates => template_tests}/loaders.py (100%) rename tests/{templates => template_tests}/models.py (100%) rename tests/{templates => template_tests}/nodelist.py (100%) rename tests/{templates => template_tests}/parser.py (100%) rename tests/{templates => template_tests}/response.py (97%) rename tests/{templates => template_tests}/smartif.py (100%) rename tests/{templates => template_tests}/templates/broken_base.html (100%) rename tests/{templates => template_tests}/templates/first/test.html (100%) rename tests/{templates => template_tests}/templates/inclusion.html (100%) rename tests/{templates => template_tests}/templates/response.html (100%) rename tests/{templates => template_tests}/templates/second/test.html (100%) rename tests/{templates => template_tests}/templates/ssi include with spaces.html (100%) rename tests/{templates => template_tests}/templates/ssi_include.html (100%) rename tests/{templates => template_tests}/templates/test_context.html (100%) rename tests/{templates => template_tests}/templates/test_extends_error.html (100%) rename tests/{templates => template_tests}/templates/test_incl_tag_current_app.html (100%) rename tests/{templates => template_tests}/templates/test_incl_tag_use_l10n.html (100%) rename tests/{templates => template_tests}/templates/test_include_error.html (100%) rename tests/{templates => template_tests}/templatetags/__init__.py (100%) rename tests/{templates => template_tests}/templatetags/bad_tag.py (100%) rename tests/{templates => template_tests}/templatetags/broken_tag.py (100%) rename tests/{templates => template_tests}/templatetags/custom.py (100%) rename tests/{templates => template_tests}/templatetags/subpackage/__init__.py (100%) rename tests/{templates => template_tests}/templatetags/subpackage/echo.py (100%) rename tests/{templates => template_tests}/templatetags/subpackage/echo_invalid.py (100%) rename tests/{templates => template_tests}/tests.py (97%) rename tests/{templates => template_tests}/unicode.py (100%) rename tests/{templates => template_tests}/urls.py (83%) rename tests/{templates => template_tests}/views.py (100%) rename tests/{test_templates => templates}/base.html (100%) rename tests/{test_templates => templates}/comments/comment_notification_email.txt (100%) rename tests/{test_templates => templates}/custom_admin/add_form.html (100%) rename tests/{test_templates => templates}/custom_admin/change_form.html (100%) rename tests/{test_templates => templates}/custom_admin/change_list.html (100%) rename tests/{test_templates => templates}/custom_admin/delete_confirmation.html (100%) rename tests/{test_templates => templates}/custom_admin/delete_selected_confirmation.html (100%) rename tests/{test_templates => templates}/custom_admin/index.html (100%) rename tests/{test_templates => templates}/custom_admin/login.html (100%) rename tests/{test_templates => templates}/custom_admin/logout.html (100%) rename tests/{test_templates => templates}/custom_admin/object_history.html (100%) rename tests/{test_templates => templates}/custom_admin/password_change_done.html (100%) rename tests/{test_templates => templates}/custom_admin/password_change_form.html (100%) rename tests/{test_templates => templates}/extended.html (100%) rename tests/{test_templates => templates}/form_view.html (100%) rename tests/{test_templates => templates}/login.html (100%) rename tests/{test_templates => templates}/views/article_archive_day.html (100%) rename tests/{test_templates => templates}/views/article_archive_month.html (100%) rename tests/{test_templates => templates}/views/article_confirm_delete.html (100%) rename tests/{test_templates => templates}/views/article_detail.html (100%) rename tests/{test_templates => templates}/views/article_form.html (100%) rename tests/{test_templates => templates}/views/article_list.html (100%) rename tests/{test_templates => templates}/views/datearticle_archive_month.html (100%) rename tests/{test_templates => templates}/views/urlarticle_detail.html (100%) rename tests/{test_templates => templates}/views/urlarticle_form.html (100%) rename tests/{utils => utils_tests}/__init__.py (100%) rename tests/{utils => utils_tests}/archive.py (100%) rename tests/{utils => utils_tests}/archives/foobar.tar (100%) rename tests/{utils => utils_tests}/archives/foobar.tar.bz2 (100%) rename tests/{utils => utils_tests}/archives/foobar.tar.gz (100%) rename tests/{utils => utils_tests}/archives/foobar.zip (100%) rename tests/{utils => utils_tests}/baseconv.py (100%) rename tests/{utils => utils_tests}/checksums.py (100%) rename tests/{utils => utils_tests}/crypto.py (100%) rename tests/{utils => utils_tests}/datastructures.py (100%) rename tests/{utils => utils_tests}/dateformat.py (100%) rename tests/{utils => utils_tests}/dateparse.py (100%) rename tests/{utils => utils_tests}/datetime_safe.py (100%) rename tests/{utils => utils_tests}/decorators.py (100%) rename tests/{utils => utils_tests}/eggs/test_egg.egg (100%) rename tests/{utils => utils_tests}/encoding.py (100%) rename tests/{utils => utils_tests}/feedgenerator.py (100%) rename tests/{utils => utils_tests}/functional.py (100%) rename tests/{utils => utils_tests}/html.py (100%) rename tests/{utils => utils_tests}/http.py (100%) rename tests/{utils => utils_tests}/ipv6.py (100%) rename tests/{utils => utils_tests}/jslex.py (100%) rename tests/{utils => utils_tests}/models.py (100%) rename tests/{utils => utils_tests}/module_loading.py (88%) rename tests/{utils => utils_tests}/numberformat.py (100%) rename tests/{utils => utils_tests}/os_utils.py (100%) rename tests/{utils => utils_tests}/regex_helper.py (100%) rename tests/{utils => utils_tests}/simplelazyobject.py (100%) rename tests/{utils => utils_tests}/termcolors.py (100%) rename tests/{utils => utils_tests}/test_module/__init__.py (100%) rename tests/{utils => utils_tests}/test_module/bad_module.py (100%) rename tests/{utils => utils_tests}/test_module/good_module.py (100%) rename tests/{utils => utils_tests}/test_no_submodule.py (100%) rename tests/{utils => utils_tests}/tests.py (100%) rename tests/{utils => utils_tests}/text.py (100%) rename tests/{utils => utils_tests}/timesince.py (100%) rename tests/{utils => utils_tests}/timezone.py (100%) rename tests/{utils => utils_tests}/tzinfo.py (100%) rename tests/{views => view_tests}/__init__.py (100%) rename tests/{views => view_tests}/app0/__init__.py (100%) rename tests/{views => view_tests}/app0/locale/en/LC_MESSAGES/djangojs.mo (100%) rename tests/{views => view_tests}/app0/locale/en/LC_MESSAGES/djangojs.po (100%) rename tests/{views => view_tests}/app1/__init__.py (100%) rename tests/{views => view_tests}/app1/locale/fr/LC_MESSAGES/djangojs.mo (100%) rename tests/{views => view_tests}/app1/locale/fr/LC_MESSAGES/djangojs.po (100%) rename tests/{views => view_tests}/app2/__init__.py (100%) rename tests/{views => view_tests}/app2/locale/fr/LC_MESSAGES/djangojs.mo (100%) rename tests/{views => view_tests}/app2/locale/fr/LC_MESSAGES/djangojs.po (100%) rename tests/{views => view_tests}/app3/__init__.py (100%) rename tests/{views => view_tests}/app3/locale/es_AR/LC_MESSAGES/djangojs.mo (100%) rename tests/{views => view_tests}/app3/locale/es_AR/LC_MESSAGES/djangojs.po (100%) rename tests/{views => view_tests}/app4/__init__.py (100%) rename tests/{views => view_tests}/app4/locale/es_AR/LC_MESSAGES/djangojs.mo (100%) rename tests/{views => view_tests}/app4/locale/es_AR/LC_MESSAGES/djangojs.po (100%) rename tests/{views => view_tests}/fixtures/testdata.json (83%) rename tests/{views => view_tests}/generic_urls.py (91%) rename tests/{views => view_tests}/locale/de/LC_MESSAGES/djangojs.mo (100%) rename tests/{views => view_tests}/locale/de/LC_MESSAGES/djangojs.po (100%) rename tests/{views => view_tests}/locale/es/LC_MESSAGES/djangojs.mo (100%) rename tests/{views => view_tests}/locale/es/LC_MESSAGES/djangojs.po (100%) rename tests/{views => view_tests}/locale/fr/LC_MESSAGES/djangojs.mo (100%) rename tests/{views => view_tests}/locale/fr/LC_MESSAGES/djangojs.po (100%) rename tests/{views => view_tests}/locale/ru/LC_MESSAGES/djangojs.mo (100%) rename tests/{views => view_tests}/locale/ru/LC_MESSAGES/djangojs.po (100%) rename tests/{views => view_tests}/media/file.txt (100%) rename tests/{views => view_tests}/media/file.txt.gz (100%) rename tests/{views => view_tests}/media/file.unknown (100%) rename tests/{views => view_tests}/models.py (100%) rename tests/{views => view_tests}/templates/debug/render_test.html (100%) rename tests/{views => view_tests}/templates/debug/template_exception.html (100%) rename tests/{views => view_tests}/templates/jsi18n.html (100%) rename tests/{views => view_tests}/templatetags/__init__.py (100%) rename tests/{views => view_tests}/templatetags/debugtags.py (100%) rename tests/{views => view_tests}/tests/__init__.py (100%) rename tests/{views => view_tests}/tests/debug.py (99%) rename tests/{views => view_tests}/tests/defaults.py (100%) rename tests/{views => view_tests}/tests/i18n.py (94%) rename tests/{views => view_tests}/tests/shortcuts.py (98%) rename tests/{views => view_tests}/tests/specials.py (96%) rename tests/{views => view_tests}/tests/static.py (100%) rename tests/{views => view_tests}/urls.py (84%) rename tests/{views => view_tests}/views.py (100%) diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py index 7a3a5c0e03..bb39f22411 100644 --- a/tests/admin_changelist/tests.py +++ b/tests/admin_changelist/tests.py @@ -24,7 +24,7 @@ from .models import (Event, Child, Parent, Genre, Band, Musician, Group, class ChangeListTests(TestCase): - urls = "regressiontests.admin_changelist.urls" + urls = "admin_changelist.urls" def setUp(self): self.factory = RequestFactory() diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py index 7d00ea40de..91962bd821 100644 --- a/tests/admin_inlines/tests.py +++ b/tests/admin_inlines/tests.py @@ -17,7 +17,7 @@ from .models import (Holder, Inner, Holder2, Inner2, Holder3, Inner3, Person, @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class TestInline(TestCase): - urls = "regressiontests.admin_inlines.urls" + urls = "admin_inlines.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -196,7 +196,7 @@ class TestInline(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class TestInlineMedia(TestCase): - urls = "regressiontests.admin_inlines.urls" + urls = "admin_inlines.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -233,7 +233,7 @@ class TestInlineMedia(TestCase): self.assertContains(response, 'my_awesome_inline_scripts.js') class TestInlineAdminForm(TestCase): - urls = "regressiontests.admin_inlines.urls" + urls = "admin_inlines.urls" def test_immutable_content_type(self): """Regression for #9362 @@ -256,7 +256,7 @@ class TestInlinePermissions(TestCase): inline. Refs #8060. """ - urls = "regressiontests.admin_inlines.urls" + urls = "admin_inlines.urls" def setUp(self): self.user = User(username='admin') @@ -451,7 +451,7 @@ class TestInlinePermissions(TestCase): class SeleniumFirefoxTests(AdminSeleniumWebDriverTestCase): webdriver_class = 'selenium.webdriver.firefox.webdriver.WebDriver' fixtures = ['admin-views-users.xml'] - urls = "regressiontests.admin_inlines.urls" + urls = "admin_inlines.urls" def test_add_stackeds(self): """ diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 921108600e..e96bd440cf 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -25,11 +25,17 @@ from django.utils._os import upath from django.utils.six import StringIO from django.test import LiveServerTestCase -test_dir = os.path.dirname(os.path.dirname(upath(__file__))) + +test_dir = os.path.join(os.environ['DJANGO_TEST_TEMP_DIR'], 'test_project') +if not os.path.exists(test_dir): + os.mkdir(test_dir) + open(os.path.join(test_dir, '__init__.py'), 'w').close() + +custom_templates_dir = os.path.join(os.path.dirname(__file__), 'custom_templates') + class AdminScriptTestCase(unittest.TestCase): def write_settings(self, filename, apps=None, is_dir=False, sdict=None): - test_dir = os.path.dirname(os.path.dirname(upath(__file__))) if is_dir: settings_dir = os.path.join(test_dir, filename) os.mkdir(settings_dir) @@ -38,7 +44,7 @@ class AdminScriptTestCase(unittest.TestCase): settings_file_path = os.path.join(test_dir, filename) with open(settings_file_path, 'w') as settings_file: - settings_file.write('# Settings file automatically generated by regressiontests.admin_scripts test case\n') + settings_file.write('# Settings file automatically generated by admin_scripts test case\n') exports = [ 'DATABASES', 'ROOT_URLCONF', @@ -52,7 +58,7 @@ class AdminScriptTestCase(unittest.TestCase): settings_file.write("%s = %s\n" % (s, o)) if apps is None: - apps = ['django.contrib.auth', 'django.contrib.contenttypes', 'regressiontests.admin_scripts'] + apps = ['django.contrib.auth', 'django.contrib.contenttypes', 'admin_scripts'] settings_file.write("INSTALLED_APPS = %s\n" % apps) @@ -91,16 +97,18 @@ class AdminScriptTestCase(unittest.TestCase): first_package_re = re.compile(r'(^[^\.]+)\.') for backend in settings.DATABASES.values(): result = first_package_re.findall(backend['ENGINE']) - if result and result != 'django': + if result and result != ['django']: backend_pkg = __import__(result[0]) backend_dir = os.path.dirname(backend_pkg.__file__) paths.append(os.path.dirname(backend_dir)) return paths def run_test(self, script, args, settings_file=None, apps=None): - test_dir = os.path.dirname(os.path.dirname(__file__)) - project_dir = os.path.dirname(test_dir) + project_dir = test_dir base_dir = os.path.dirname(project_dir) + import django + django_dir = os.path.dirname(os.path.dirname(django.__file__)) + tests_dir = os.path.join(django_dir, 'tests') ext_backend_base_dirs = self._ext_backend_paths() # Remember the old environment @@ -118,7 +126,7 @@ class AdminScriptTestCase(unittest.TestCase): os.environ['DJANGO_SETTINGS_MODULE'] = settings_file elif 'DJANGO_SETTINGS_MODULE' in os.environ: del os.environ['DJANGO_SETTINGS_MODULE'] - python_path = [project_dir, base_dir] + python_path = [project_dir, base_dir, django_dir, tests_dir] python_path.extend(ext_backend_base_dirs) os.environ[python_path_var_name] = os.pathsep.join(python_path) @@ -127,7 +135,6 @@ class AdminScriptTestCase(unittest.TestCase): out, err = subprocess.Popen([sys.executable, script] + args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True).communicate() - # Restore the old environment if old_django_settings_module: os.environ['DJANGO_SETTINGS_MODULE'] = old_django_settings_module @@ -158,7 +165,7 @@ class AdminScriptTestCase(unittest.TestCase): with open(test_manage_py, 'r') as fp: manage_py_contents = fp.read() manage_py_contents = manage_py_contents.replace( - "{{ project_name }}", "regressiontests") + "{{ project_name }}", "test_project") with open(test_manage_py, 'w') as fp: fp.write(manage_py_contents) self.addCleanup(safe_remove, test_manage_py) @@ -230,7 +237,7 @@ class DjangoAdminDefaultSettings(AdminScriptTestCase): def test_builtin_with_settings(self): "default: django-admin builtin commands succeed if settings are provided as argument" - args = ['sqlall', '--settings=regressiontests.settings', 'admin_scripts'] + args = ['sqlall', '--settings=test_project.settings', 'admin_scripts'] out, err = self.run_django_admin(args) self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -238,7 +245,7 @@ class DjangoAdminDefaultSettings(AdminScriptTestCase): def test_builtin_with_environment(self): "default: django-admin builtin commands succeed if settings are provided in the environment" args = ['sqlall', 'admin_scripts'] - out, err = self.run_django_admin(args, 'regressiontests.settings') + out, err = self.run_django_admin(args, 'test_project.settings') self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -265,7 +272,7 @@ class DjangoAdminDefaultSettings(AdminScriptTestCase): def test_custom_command_with_settings(self): "default: django-admin can execute user commands if settings are provided as argument" - args = ['noargs_command', '--settings=regressiontests.settings'] + args = ['noargs_command', '--settings=test_project.settings'] out, err = self.run_django_admin(args) self.assertNoOutput(err) self.assertOutput(out, "EXECUTE:NoArgsCommand") @@ -273,7 +280,7 @@ class DjangoAdminDefaultSettings(AdminScriptTestCase): def test_custom_command_with_environment(self): "default: django-admin can execute user commands if settings are provided in environment" args = ['noargs_command'] - out, err = self.run_django_admin(args, 'regressiontests.settings') + out, err = self.run_django_admin(args, 'test_project.settings') self.assertNoOutput(err) self.assertOutput(out, "EXECUTE:NoArgsCommand") @@ -282,7 +289,7 @@ class DjangoAdminFullPathDefaultSettings(AdminScriptTestCase): contains the test application specified using a full path. """ def setUp(self): - self.write_settings('settings.py', ['django.contrib.auth', 'django.contrib.contenttypes', 'regressiontests.admin_scripts']) + self.write_settings('settings.py', ['django.contrib.auth', 'django.contrib.contenttypes', 'admin_scripts']) def tearDown(self): self.remove_settings('settings.py') @@ -296,7 +303,7 @@ class DjangoAdminFullPathDefaultSettings(AdminScriptTestCase): def test_builtin_with_settings(self): "fulldefault: django-admin builtin commands succeed if a settings file is provided" - args = ['sqlall', '--settings=regressiontests.settings', 'admin_scripts'] + args = ['sqlall', '--settings=test_project.settings', 'admin_scripts'] out, err = self.run_django_admin(args) self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -304,7 +311,7 @@ class DjangoAdminFullPathDefaultSettings(AdminScriptTestCase): def test_builtin_with_environment(self): "fulldefault: django-admin builtin commands succeed if the environment contains settings" args = ['sqlall', 'admin_scripts'] - out, err = self.run_django_admin(args, 'regressiontests.settings') + out, err = self.run_django_admin(args, 'test_project.settings') self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -331,7 +338,7 @@ class DjangoAdminFullPathDefaultSettings(AdminScriptTestCase): def test_custom_command_with_settings(self): "fulldefault: django-admin can execute user commands if settings are provided as argument" - args = ['noargs_command', '--settings=regressiontests.settings'] + args = ['noargs_command', '--settings=test_project.settings'] out, err = self.run_django_admin(args) self.assertNoOutput(err) self.assertOutput(out, "EXECUTE:NoArgsCommand") @@ -339,7 +346,7 @@ class DjangoAdminFullPathDefaultSettings(AdminScriptTestCase): def test_custom_command_with_environment(self): "fulldefault: django-admin can execute user commands if settings are provided in environment" args = ['noargs_command'] - out, err = self.run_django_admin(args, 'regressiontests.settings') + out, err = self.run_django_admin(args, 'test_project.settings') self.assertNoOutput(err) self.assertOutput(out, "EXECUTE:NoArgsCommand") @@ -362,7 +369,7 @@ class DjangoAdminMinimalSettings(AdminScriptTestCase): def test_builtin_with_settings(self): "minimal: django-admin builtin commands fail if settings are provided as argument" - args = ['sqlall', '--settings=regressiontests.settings', 'admin_scripts'] + args = ['sqlall', '--settings=test_project.settings', 'admin_scripts'] out, err = self.run_django_admin(args) self.assertNoOutput(out) self.assertOutput(err, 'App with label admin_scripts could not be found') @@ -370,7 +377,7 @@ class DjangoAdminMinimalSettings(AdminScriptTestCase): def test_builtin_with_environment(self): "minimal: django-admin builtin commands fail if settings are provided in the environment" args = ['sqlall', 'admin_scripts'] - out, err = self.run_django_admin(args, 'regressiontests.settings') + out, err = self.run_django_admin(args, 'test_project.settings') self.assertNoOutput(out) self.assertOutput(err, 'App with label admin_scripts could not be found') @@ -397,7 +404,7 @@ class DjangoAdminMinimalSettings(AdminScriptTestCase): def test_custom_command_with_settings(self): "minimal: django-admin can't execute user commands, even if settings are provided as argument" - args = ['noargs_command', '--settings=regressiontests.settings'] + args = ['noargs_command', '--settings=test_project.settings'] out, err = self.run_django_admin(args) self.assertNoOutput(out) self.assertOutput(err, "Unknown command: 'noargs_command'") @@ -405,7 +412,7 @@ class DjangoAdminMinimalSettings(AdminScriptTestCase): def test_custom_command_with_environment(self): "minimal: django-admin can't execute user commands, even if settings are provided in environment" args = ['noargs_command'] - out, err = self.run_django_admin(args, 'regressiontests.settings') + out, err = self.run_django_admin(args, 'test_project.settings') self.assertNoOutput(out) self.assertOutput(err, "Unknown command: 'noargs_command'") @@ -428,7 +435,7 @@ class DjangoAdminAlternateSettings(AdminScriptTestCase): def test_builtin_with_settings(self): "alternate: django-admin builtin commands succeed if settings are provided as argument" - args = ['sqlall', '--settings=regressiontests.alternate_settings', 'admin_scripts'] + args = ['sqlall', '--settings=test_project.alternate_settings', 'admin_scripts'] out, err = self.run_django_admin(args) self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -436,7 +443,7 @@ class DjangoAdminAlternateSettings(AdminScriptTestCase): def test_builtin_with_environment(self): "alternate: django-admin builtin commands succeed if settings are provided in the environment" args = ['sqlall', 'admin_scripts'] - out, err = self.run_django_admin(args, 'regressiontests.alternate_settings') + out, err = self.run_django_admin(args, 'test_project.alternate_settings') self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -463,7 +470,7 @@ class DjangoAdminAlternateSettings(AdminScriptTestCase): def test_custom_command_with_settings(self): "alternate: django-admin can execute user commands if settings are provided as argument" - args = ['noargs_command', '--settings=regressiontests.alternate_settings'] + args = ['noargs_command', '--settings=test_project.alternate_settings'] out, err = self.run_django_admin(args) self.assertNoOutput(err) self.assertOutput(out, "EXECUTE:NoArgsCommand") @@ -471,7 +478,7 @@ class DjangoAdminAlternateSettings(AdminScriptTestCase): def test_custom_command_with_environment(self): "alternate: django-admin can execute user commands if settings are provided in environment" args = ['noargs_command'] - out, err = self.run_django_admin(args, 'regressiontests.alternate_settings') + out, err = self.run_django_admin(args, 'test_project.alternate_settings') self.assertNoOutput(err) self.assertOutput(out, "EXECUTE:NoArgsCommand") @@ -499,7 +506,7 @@ class DjangoAdminMultipleSettings(AdminScriptTestCase): def test_builtin_with_settings(self): "alternate: django-admin builtin commands succeed if settings are provided as argument" - args = ['sqlall', '--settings=regressiontests.alternate_settings', 'admin_scripts'] + args = ['sqlall', '--settings=test_project.alternate_settings', 'admin_scripts'] out, err = self.run_django_admin(args) self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -507,7 +514,7 @@ class DjangoAdminMultipleSettings(AdminScriptTestCase): def test_builtin_with_environment(self): "alternate: django-admin builtin commands succeed if settings are provided in the environment" args = ['sqlall', 'admin_scripts'] - out, err = self.run_django_admin(args, 'regressiontests.alternate_settings') + out, err = self.run_django_admin(args, 'test_project.alternate_settings') self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -533,7 +540,7 @@ class DjangoAdminMultipleSettings(AdminScriptTestCase): def test_custom_command_with_settings(self): "alternate: django-admin can execute user commands if settings are provided as argument" - args = ['noargs_command', '--settings=regressiontests.alternate_settings'] + args = ['noargs_command', '--settings=test_project.alternate_settings'] out, err = self.run_django_admin(args) self.assertNoOutput(err) self.assertOutput(out, "EXECUTE:NoArgsCommand") @@ -541,7 +548,7 @@ class DjangoAdminMultipleSettings(AdminScriptTestCase): def test_custom_command_with_environment(self): "alternate: django-admin can execute user commands if settings are provided in environment" args = ['noargs_command'] - out, err = self.run_django_admin(args, 'regressiontests.alternate_settings') + out, err = self.run_django_admin(args, 'test_project.alternate_settings') self.assertNoOutput(err) self.assertOutput(out, "EXECUTE:NoArgsCommand") @@ -562,17 +569,17 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase): "directory: startapp creates the correct directory" args = ['startapp', 'settings_test'] app_path = os.path.join(test_dir, 'settings_test') - out, err = self.run_django_admin(args, 'regressiontests.settings') + out, err = self.run_django_admin(args, 'test_project.settings') self.addCleanup(shutil.rmtree, app_path) self.assertNoOutput(err) self.assertTrue(os.path.exists(app_path)) def test_setup_environ_custom_template(self): "directory: startapp creates the correct directory with a custom template" - template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'app_template') + template_path = os.path.join(custom_templates_dir, 'app_template') args = ['startapp', '--template', template_path, 'custom_settings_test'] app_path = os.path.join(test_dir, 'custom_settings_test') - out, err = self.run_django_admin(args, 'regressiontests.settings') + out, err = self.run_django_admin(args, 'test_project.settings') self.addCleanup(shutil.rmtree, app_path) self.assertNoOutput(err) self.assertTrue(os.path.exists(app_path)) @@ -607,7 +614,7 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase): def test_builtin_with_settings(self): "directory: django-admin builtin commands succeed if settings are provided as argument" - args = ['sqlall', '--settings=regressiontests.settings', 'admin_scripts'] + args = ['sqlall', '--settings=test_project.settings', 'admin_scripts'] out, err = self.run_django_admin(args) self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -615,7 +622,7 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase): def test_builtin_with_environment(self): "directory: django-admin builtin commands succeed if settings are provided in the environment" args = ['sqlall', 'admin_scripts'] - out, err = self.run_django_admin(args, 'regressiontests.settings') + out, err = self.run_django_admin(args, 'test_project.settings') self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -634,7 +641,7 @@ class ManageNoSettings(AdminScriptTestCase): args = ['sqlall', 'admin_scripts'] out, err = self.run_manage(args) self.assertNoOutput(out) - self.assertOutput(err, "Could not import settings 'regressiontests.settings'") + self.assertOutput(err, "Could not import settings 'test_project.settings'") def test_builtin_with_bad_settings(self): "no settings: manage.py builtin commands fail if settings file (from argument) doesn't exist" @@ -670,7 +677,7 @@ class ManageDefaultSettings(AdminScriptTestCase): def test_builtin_with_settings(self): "default: manage.py builtin commands succeed if settings are provided as argument" - args = ['sqlall', '--settings=regressiontests.settings', 'admin_scripts'] + args = ['sqlall', '--settings=test_project.settings', 'admin_scripts'] out, err = self.run_manage(args) self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -678,7 +685,7 @@ class ManageDefaultSettings(AdminScriptTestCase): def test_builtin_with_environment(self): "default: manage.py builtin commands succeed if settings are provided in the environment" args = ['sqlall', 'admin_scripts'] - out, err = self.run_manage(args, 'regressiontests.settings') + out, err = self.run_manage(args, 'test_project.settings') self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -705,7 +712,7 @@ class ManageDefaultSettings(AdminScriptTestCase): def test_custom_command_with_settings(self): "default: manage.py can execute user commands when settings are provided as argument" - args = ['noargs_command', '--settings=regressiontests.settings'] + args = ['noargs_command', '--settings=test_project.settings'] out, err = self.run_manage(args) self.assertNoOutput(err) self.assertOutput(out, "EXECUTE:NoArgsCommand") @@ -713,7 +720,7 @@ class ManageDefaultSettings(AdminScriptTestCase): def test_custom_command_with_environment(self): "default: manage.py can execute user commands when settings are provided in environment" args = ['noargs_command'] - out, err = self.run_manage(args, 'regressiontests.settings') + out, err = self.run_manage(args, 'test_project.settings') self.assertNoOutput(err) self.assertOutput(out, "EXECUTE:NoArgsCommand") @@ -723,7 +730,7 @@ class ManageFullPathDefaultSettings(AdminScriptTestCase): contains the test application specified using a full path. """ def setUp(self): - self.write_settings('settings.py', ['django.contrib.auth', 'django.contrib.contenttypes', 'regressiontests.admin_scripts']) + self.write_settings('settings.py', ['django.contrib.auth', 'django.contrib.contenttypes', 'admin_scripts']) def tearDown(self): self.remove_settings('settings.py') @@ -737,7 +744,7 @@ class ManageFullPathDefaultSettings(AdminScriptTestCase): def test_builtin_with_settings(self): "fulldefault: manage.py builtin commands succeed if settings are provided as argument" - args = ['sqlall', '--settings=regressiontests.settings', 'admin_scripts'] + args = ['sqlall', '--settings=test_project.settings', 'admin_scripts'] out, err = self.run_manage(args) self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -745,7 +752,7 @@ class ManageFullPathDefaultSettings(AdminScriptTestCase): def test_builtin_with_environment(self): "fulldefault: manage.py builtin commands succeed if settings are provided in the environment" args = ['sqlall', 'admin_scripts'] - out, err = self.run_manage(args, 'regressiontests.settings') + out, err = self.run_manage(args, 'test_project.settings') self.assertNoOutput(err) self.assertOutput(out, 'CREATE TABLE') @@ -772,7 +779,7 @@ class ManageFullPathDefaultSettings(AdminScriptTestCase): def test_custom_command_with_settings(self): "fulldefault: manage.py can execute user commands when settings are provided as argument" - args = ['noargs_command', '--settings=regressiontests.settings'] + args = ['noargs_command', '--settings=test_project.settings'] out, err = self.run_manage(args) self.assertNoOutput(err) self.assertOutput(out, "EXECUTE:NoArgsCommand") @@ -780,7 +787,7 @@ class ManageFullPathDefaultSettings(AdminScriptTestCase): def test_custom_command_with_environment(self): "fulldefault: manage.py can execute user commands when settings are provided in environment" args = ['noargs_command'] - out, err = self.run_manage(args, 'regressiontests.settings') + out, err = self.run_manage(args, 'test_project.settings') self.assertNoOutput(err) self.assertOutput(out, "EXECUTE:NoArgsCommand") @@ -803,7 +810,7 @@ class ManageMinimalSettings(AdminScriptTestCase): def test_builtin_with_settings(self): "minimal: manage.py builtin commands fail if settings are provided as argument" - args = ['sqlall', '--settings=regressiontests.settings', 'admin_scripts'] + args = ['sqlall', '--settings=test_project.settings', 'admin_scripts'] out, err = self.run_manage(args) self.assertNoOutput(out) self.assertOutput(err, 'App with label admin_scripts could not be found') @@ -811,7 +818,7 @@ class ManageMinimalSettings(AdminScriptTestCase): def test_builtin_with_environment(self): "minimal: manage.py builtin commands fail if settings are provided in the environment" args = ['sqlall', 'admin_scripts'] - out, err = self.run_manage(args, 'regressiontests.settings') + out, err = self.run_manage(args, 'test_project.settings') self.assertNoOutput(out) self.assertOutput(err, 'App with label admin_scripts could not be found') @@ -838,7 +845,7 @@ class ManageMinimalSettings(AdminScriptTestCase): def test_custom_command_with_settings(self): "minimal: manage.py can't execute user commands, even if settings are provided as argument" - args = ['noargs_command', '--settings=regressiontests.settings'] + args = ['noargs_command', '--settings=test_project.settings'] out, err = self.run_manage(args) self.assertNoOutput(out) self.assertOutput(err, "Unknown command: 'noargs_command'") @@ -846,7 +853,7 @@ class ManageMinimalSettings(AdminScriptTestCase): def test_custom_command_with_environment(self): "minimal: manage.py can't execute user commands, even if settings are provided in environment" args = ['noargs_command'] - out, err = self.run_manage(args, 'regressiontests.settings') + out, err = self.run_manage(args, 'test_project.settings') self.assertNoOutput(out) self.assertOutput(err, "Unknown command: 'noargs_command'") @@ -865,7 +872,7 @@ class ManageAlternateSettings(AdminScriptTestCase): args = ['sqlall', 'admin_scripts'] out, err = self.run_manage(args) self.assertNoOutput(out) - self.assertOutput(err, "Could not import settings 'regressiontests.settings'") + self.assertOutput(err, "Could not import settings 'test_project.settings'") def test_builtin_with_settings(self): "alternate: manage.py builtin commands work with settings provided as argument" @@ -904,7 +911,7 @@ class ManageAlternateSettings(AdminScriptTestCase): args = ['noargs_command'] out, err = self.run_manage(args) self.assertNoOutput(out) - self.assertOutput(err, "Could not import settings 'regressiontests.settings'") + self.assertOutput(err, "Could not import settings 'test_project.settings'") def test_custom_command_with_settings(self): "alternate: manage.py can execute user commands if settings are provided as argument" @@ -1007,7 +1014,7 @@ class ManageSettingsWithImportError(AdminScriptTestCase): else: settings_file_path = os.path.join(test_dir, filename) with open(settings_file_path, 'w') as settings_file: - settings_file.write('# Settings file automatically generated by regressiontests.admin_scripts test case\n') + settings_file.write('# Settings file automatically generated by admin_scripts test case\n') settings_file.write('# The next line will cause an import error:\nimport foo42bar\n') def test_builtin_command(self): @@ -1104,13 +1111,13 @@ class ManageTestCommand(AdminScriptTestCase): address_predefined = 'DJANGO_LIVE_TEST_SERVER_ADDRESS' in os.environ old_address = os.environ.get('DJANGO_LIVE_TEST_SERVER_ADDRESS') - self.cmd.handle(verbosity=0, testrunner='regressiontests.admin_scripts.tests.CustomTestRunner') + self.cmd.handle(verbosity=0, testrunner='admin_scripts.tests.CustomTestRunner') # Original state hasn't changed self.assertEqual('DJANGO_LIVE_TEST_SERVER_ADDRESS' in os.environ, address_predefined) self.assertEqual(os.environ.get('DJANGO_LIVE_TEST_SERVER_ADDRESS'), old_address) - self.cmd.handle(verbosity=0, testrunner='regressiontests.admin_scripts.tests.CustomTestRunner', + self.cmd.handle(verbosity=0, testrunner='admin_scripts.tests.CustomTestRunner', liveserver='blah') # Variable was correctly set @@ -1485,7 +1492,7 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase): def test_custom_project_template(self): "Make sure the startproject management command is able to use a different project template" - template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template') + template_path = os.path.join(custom_templates_dir, 'project_template') args = ['startproject', '--template', template_path, 'customtestproject'] testproject_dir = os.path.join(test_dir, 'customtestproject') self.addCleanup(shutil.rmtree, testproject_dir, True) @@ -1497,7 +1504,7 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase): def test_template_dir_with_trailing_slash(self): "Ticket 17475: Template dir passed has a trailing path separator" - template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template' + os.sep) + template_path = os.path.join(custom_templates_dir, 'project_template' + os.sep) args = ['startproject', '--template', template_path, 'customtestproject'] testproject_dir = os.path.join(test_dir, 'customtestproject') self.addCleanup(shutil.rmtree, testproject_dir, True) @@ -1509,7 +1516,7 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase): def test_custom_project_template_from_tarball_by_path(self): "Make sure the startproject management command is able to use a different project template from a tarball" - template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template.tgz') + template_path = os.path.join(custom_templates_dir, 'project_template.tgz') args = ['startproject', '--template', template_path, 'tarballtestproject'] testproject_dir = os.path.join(test_dir, 'tarballtestproject') self.addCleanup(shutil.rmtree, testproject_dir, True) @@ -1521,7 +1528,7 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase): def test_custom_project_template_from_tarball_to_alternative_location(self): "Startproject can use a project template from a tarball and create it in a specified location" - template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template.tgz') + template_path = os.path.join(custom_templates_dir, 'project_template.tgz') args = ['startproject', '--template', template_path, 'tarballtestproject', 'altlocation'] testproject_dir = os.path.join(test_dir, 'altlocation') os.mkdir(testproject_dir) @@ -1560,7 +1567,7 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase): def test_file_without_extension(self): "Make sure the startproject management command is able to render custom files" - template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template') + template_path = os.path.join(custom_templates_dir, 'project_template') args = ['startproject', '--template', template_path, 'customtestproject', '-e', 'txt', '-n', 'Procfile'] testproject_dir = os.path.join(test_dir, 'customtestproject') self.addCleanup(shutil.rmtree, testproject_dir, True) @@ -1578,7 +1585,7 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase): def test_custom_project_template_context_variables(self): "Make sure template context variables are rendered with proper values" - template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template') + template_path = os.path.join(custom_templates_dir, 'project_template') args = ['startproject', '--template', template_path, 'another_project', 'project_dir'] testproject_dir = os.path.join(test_dir, 'project_dir') os.mkdir(testproject_dir) @@ -1596,7 +1603,7 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase): # We're using a custom command so we need the alternate settings self.write_settings('alternate_settings.py') self.addCleanup(self.remove_settings, 'alternate_settings.py') - template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template') + template_path = os.path.join(custom_templates_dir, 'project_template') args = ['custom_startproject', '--template', template_path, 'another_project', 'project_dir', '--extra', '<&>', '--settings=alternate_settings'] testproject_dir = os.path.join(test_dir, 'project_dir') os.mkdir(testproject_dir) @@ -1613,7 +1620,7 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase): Make sure an exception is raised when the provided destination directory doesn't exist """ - template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template') + template_path = os.path.join(custom_templates_dir, 'project_template') args = ['startproject', '--template', template_path, 'yet_another_project', 'project_dir2'] testproject_dir = os.path.join(test_dir, 'project_dir2') out, err = self.run_django_admin(args) @@ -1623,7 +1630,7 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase): def test_custom_project_template_with_non_ascii_templates(self): "Ticket 18091: Make sure the startproject management command is able to render templates with non-ASCII content" - template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template') + template_path = os.path.join(custom_templates_dir, 'project_template') args = ['startproject', '--template', template_path, '--extension=txt', 'customtestproject'] testproject_dir = os.path.join(test_dir, 'customtestproject') self.addCleanup(shutil.rmtree, testproject_dir, True) diff --git a/tests/admin_validation/tests.py b/tests/admin_validation/tests.py index b9b42c6bb9..5b2c45f6f2 100644 --- a/tests/admin_validation/tests.py +++ b/tests/admin_validation/tests.py @@ -142,7 +142,7 @@ class ValidationTestCase(TestCase): model = TwoAlbumFKAndAnE self.assertRaisesMessage(Exception, - " has more than 1 ForeignKey to ", + " has more than 1 ForeignKey to ", validate_inline, TwoAlbumFKAndAnEInline, None, Album) diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index d3cfaa3e24..0bcfc0c034 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -64,7 +64,7 @@ class AdminViewBasicTest(TestCase): # this test case and changing urlbit. urlbit = 'admin' - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" def setUp(self): self.old_USE_I18N = settings.USE_I18N @@ -610,7 +610,7 @@ class AdminViewBasicTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminViewFormUrlTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ["admin-views-users.xml"] urlbit = "admin3" @@ -644,7 +644,7 @@ class AdminViewFormUrlTest(TestCase): class AdminJavaScriptTest(TestCase): fixtures = ['admin-views-users.xml'] - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" def setUp(self): self.client.login(username='super', password='secret') @@ -709,7 +709,7 @@ class AdminJavaScriptTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class SaveAsTests(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml', 'admin-views-person.xml'] def setUp(self): @@ -739,7 +739,7 @@ class SaveAsTests(TestCase): class CustomModelAdminTest(AdminViewBasicTest): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" urlbit = "admin2" def testCustomAdminSiteLoginForm(self): @@ -816,7 +816,7 @@ def get_perm(Model, perm): class AdminViewPermissionsTest(TestCase): """Tests for Admin Views Permissions.""" - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -1257,7 +1257,7 @@ class AdminViewPermissionsTest(TestCase): class AdminViewsNoUrlTest(TestCase): """Regression test for #17333""" - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -1287,7 +1287,7 @@ class AdminViewsNoUrlTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminViewDeletedObjectsTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml', 'deleted-objects.xml'] def setUp(self): @@ -1405,7 +1405,7 @@ class AdminViewDeletedObjectsTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminViewStringPrimaryKeyTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml', 'string-primary-key.xml'] def __init__(self, *args): @@ -1526,7 +1526,7 @@ class AdminViewStringPrimaryKeyTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class SecureViewTests(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -1686,7 +1686,7 @@ class SecureViewTests(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminViewUnicodeTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-unicode.xml'] def setUp(self): @@ -1741,7 +1741,7 @@ class AdminViewUnicodeTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminViewListEditable(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml', 'admin-views-person.xml'] def setUp(self): @@ -2118,7 +2118,7 @@ class AdminViewListEditable(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminSearchTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users', 'multiple-child-classes', 'admin-views-person'] @@ -2166,7 +2166,7 @@ class AdminSearchTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminInheritedInlinesTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -2254,7 +2254,7 @@ class AdminInheritedInlinesTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminActionsTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml', 'admin-views-actions.xml'] def setUp(self): @@ -2473,7 +2473,7 @@ class AdminActionsTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class TestCustomChangeList(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] urlbit = 'admin' @@ -2502,7 +2502,7 @@ class TestCustomChangeList(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class TestInlineNotEditable(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -2522,7 +2522,7 @@ class TestInlineNotEditable(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminCustomQuerysetTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -2748,7 +2748,7 @@ class AdminCustomQuerysetTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminInlineFileUploadTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml', 'admin-views-actions.xml'] urlbit = 'admin' @@ -2795,7 +2795,7 @@ class AdminInlineFileUploadTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminInlineTests(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -3114,7 +3114,7 @@ class AdminInlineTests(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class NeverCacheTests(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml', 'admin-views-colors.xml', 'admin-views-fabrics.xml'] def setUp(self): @@ -3188,7 +3188,7 @@ class NeverCacheTests(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class PrePopulatedTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -3225,7 +3225,7 @@ class PrePopulatedTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class SeleniumAdminViewsFirefoxTests(AdminSeleniumWebDriverTestCase): webdriver_class = 'selenium.webdriver.firefox.webdriver.WebDriver' - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def test_prepopulated_fields(self): @@ -3356,7 +3356,7 @@ class SeleniumAdminViewsIETests(SeleniumAdminViewsFirefoxTests): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class ReadonlyTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -3444,7 +3444,7 @@ class ReadonlyTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class RawIdFieldsTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -3482,7 +3482,7 @@ class UserAdminTest(TestCase): """ Tests user CRUD functionality. """ - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -3583,7 +3583,7 @@ class GroupAdminTest(TestCase): """ Tests group CRUD functionality. """ - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -3612,7 +3612,7 @@ class GroupAdminTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class CSSTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -3668,7 +3668,7 @@ except ImportError: @unittest.skipUnless(docutils, "no docutils installed.") @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminDocsTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -3711,7 +3711,7 @@ class AdminDocsTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class ValidXHTMLTests(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] urlbit = 'admin' @@ -3735,7 +3735,7 @@ class ValidXHTMLTests(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class DateHierarchyTests(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -3867,7 +3867,7 @@ class AdminCustomSaveRelatedTests(TestCase): Ensure that one can easily customize the way related objects are saved. Refs #16115. """ - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -3932,7 +3932,7 @@ class AdminCustomSaveRelatedTests(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminViewLogoutTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): @@ -3961,7 +3961,7 @@ class AdminViewLogoutTest(TestCase): @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) class AdminUserMessageTest(TestCase): - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" fixtures = ['admin-views-users.xml'] def setUp(self): diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py index d559b53531..4e09922893 100644 --- a/tests/admin_widgets/tests.py +++ b/tests/admin_widgets/tests.py @@ -460,7 +460,7 @@ class RelatedFieldWidgetWrapperTests(DjangoTestCase): class DateTimePickerSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase): webdriver_class = 'selenium.webdriver.firefox.webdriver.WebDriver' fixtures = ['admin-widgets-users.xml'] - urls = "regressiontests.admin_widgets.urls" + urls = "admin_widgets.urls" def test_show_hide_date_time_picker_widgets(self): """ @@ -516,7 +516,7 @@ class DateTimePickerSeleniumIETests(DateTimePickerSeleniumFirefoxTests): class HorizontalVerticalFilterSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase): webdriver_class = 'selenium.webdriver.firefox.webdriver.WebDriver' fixtures = ['admin-widgets-users.xml'] - urls = "regressiontests.admin_widgets.urls" + urls = "admin_widgets.urls" def setUp(self): self.lisa = models.Student.objects.create(name='Lisa') diff --git a/tests/cache/tests.py b/tests/cache/tests.py index 24e510c5d2..c1b68ec809 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -809,7 +809,7 @@ class DBCacheTests(BaseCacheTests, TransactionTestCase): self.prefix_cache = get_cache(self.backend_name, LOCATION=self._table_name, KEY_PREFIX='cacheprefix') self.v2_cache = get_cache(self.backend_name, LOCATION=self._table_name, VERSION=2) self.custom_key_cache = get_cache(self.backend_name, LOCATION=self._table_name, KEY_FUNCTION=custom_key_func) - self.custom_key_cache2 = get_cache(self.backend_name, LOCATION=self._table_name, KEY_FUNCTION='regressiontests.cache.tests.custom_key_func') + self.custom_key_cache2 = get_cache(self.backend_name, LOCATION=self._table_name, KEY_FUNCTION='cache.tests.custom_key_func') def tearDown(self): from django.db import connection @@ -897,7 +897,7 @@ class LocMemCacheTests(unittest.TestCase, BaseCacheTests): self.prefix_cache = get_cache(self.backend_name, KEY_PREFIX='cacheprefix') self.v2_cache = get_cache(self.backend_name, VERSION=2) self.custom_key_cache = get_cache(self.backend_name, OPTIONS={'MAX_ENTRIES': 30}, KEY_FUNCTION=custom_key_func) - self.custom_key_cache2 = get_cache(self.backend_name, OPTIONS={'MAX_ENTRIES': 30}, KEY_FUNCTION='regressiontests.cache.tests.custom_key_func') + self.custom_key_cache2 = get_cache(self.backend_name, OPTIONS={'MAX_ENTRIES': 30}, KEY_FUNCTION='cache.tests.custom_key_func') # LocMem requires a hack to make the other caches # share a data store with the 'normal' cache. @@ -966,7 +966,7 @@ class MemcachedCacheTests(unittest.TestCase, BaseCacheTests): self.prefix_cache = get_cache(cache_key, KEY_PREFIX=random_prefix) self.v2_cache = get_cache(cache_key, VERSION=2) self.custom_key_cache = get_cache(cache_key, KEY_FUNCTION=custom_key_func) - self.custom_key_cache2 = get_cache(cache_key, KEY_FUNCTION='regressiontests.cache.tests.custom_key_func') + self.custom_key_cache2 = get_cache(cache_key, KEY_FUNCTION='cache.tests.custom_key_func') def tearDown(self): self.cache.clear() @@ -1011,7 +1011,7 @@ class FileBasedCacheTests(unittest.TestCase, BaseCacheTests): self.prefix_cache = get_cache(self.backend_name, LOCATION=self.dirname, KEY_PREFIX='cacheprefix') self.v2_cache = get_cache(self.backend_name, LOCATION=self.dirname, VERSION=2) self.custom_key_cache = get_cache(self.backend_name, LOCATION=self.dirname, KEY_FUNCTION=custom_key_func) - self.custom_key_cache2 = get_cache(self.backend_name, LOCATION=self.dirname, KEY_FUNCTION='regressiontests.cache.tests.custom_key_func') + self.custom_key_cache2 = get_cache(self.backend_name, LOCATION=self.dirname, KEY_FUNCTION='cache.tests.custom_key_func') def tearDown(self): self.cache.clear() @@ -1055,7 +1055,7 @@ class CustomCacheKeyValidationTests(unittest.TestCase): """ def test_custom_key_validation(self): - cache = get_cache('regressiontests.cache.liberal_backend://') + cache = get_cache('cache.liberal_backend://') # this key is both longer than 250 characters, and has spaces key = 'some key with spaces' * 15 @@ -1082,7 +1082,7 @@ class GetCacheTests(unittest.TestCase): def test_close(self): from django.core import signals - cache = get_cache('regressiontests.cache.closeable_cache.CacheClass') + cache = get_cache('cache.closeable_cache.CacheClass') self.assertFalse(cache.closed) signals.request_finished.send(self.__class__) self.assertTrue(cache.closed) @@ -1865,7 +1865,7 @@ class TestWithTemplateResponse(TestCase): class TestEtagWithAdmin(TestCase): # See https://code.djangoproject.com/ticket/16003 - urls = "regressiontests.admin_views.urls" + urls = "admin_views.urls" def test_admin(self): with self.settings(USE_ETAGS=False): diff --git a/tests/commands_sql/tests.py b/tests/commands_sql/tests.py index 949032ae6f..831e9a27c4 100644 --- a/tests/commands_sql/tests.py +++ b/tests/commands_sql/tests.py @@ -7,7 +7,7 @@ from django.db import connections, DEFAULT_DB_ALIAS, models from django.test import TestCase from django.utils import six -# See also regressiontests/initial_sql_regress for 'custom_sql_for_model' tests +# See also initial_sql_regress for 'custom_sql_for_model' tests class SQLCommandsTestCase(TestCase): diff --git a/tests/comment_tests/custom_comments/__init__.py b/tests/comment_tests/custom_comments/__init__.py index 598927eace..14c614f610 100644 --- a/tests/comment_tests/custom_comments/__init__.py +++ b/tests/comment_tests/custom_comments/__init__.py @@ -1,32 +1,32 @@ from django.core import urlresolvers -from regressiontests.comment_tests.custom_comments.models import CustomComment -from regressiontests.comment_tests.custom_comments.forms import CustomCommentForm +from comment_tests.custom_comments.models import CustomComment +from comment_tests.custom_comments.forms import CustomCommentForm def get_model(): - return CustomComment + return CustomComment def get_form(): return CustomCommentForm def get_form_target(): return urlresolvers.reverse( - "regressiontests.comment_tests.custom_comments.views.custom_submit_comment" + "comment_tests.custom_comments.views.custom_submit_comment" ) def get_flag_url(c): return urlresolvers.reverse( - "regressiontests.comment_tests.custom_comments.views.custom_flag_comment", + "comment_tests.custom_comments.views.custom_flag_comment", args=(c.id,) ) def get_delete_url(c): return urlresolvers.reverse( - "regressiontests.comment_tests.custom_comments.views.custom_delete_comment", + "comment_tests.custom_comments.views.custom_delete_comment", args=(c.id,) ) def get_approve_url(c): return urlresolvers.reverse( - "regressiontests.comment_tests.custom_comments.views.custom_approve_comment", + "comment_tests.custom_comments.views.custom_approve_comment", args=(c.id,) ) diff --git a/tests/comment_tests/tests/__init__.py b/tests/comment_tests/tests/__init__.py index f80b29e17b..d959dab243 100644 --- a/tests/comment_tests/tests/__init__.py +++ b/tests/comment_tests/tests/__init__.py @@ -17,7 +17,7 @@ CT = ContentType.objects.get_for_model @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.UnsaltedMD5PasswordHasher',)) class CommentTestCase(TestCase): fixtures = ["comment_tests"] - urls = 'regressiontests.comment_tests.urls_default' + urls = 'comment_tests.urls_default' def createSomeComments(self): # Two anonymous comments on two different objects @@ -85,11 +85,11 @@ class CommentTestCase(TestCase): d.update(f.initial) return d -from regressiontests.comment_tests.tests.app_api_tests import * -from regressiontests.comment_tests.tests.feed_tests import * -from regressiontests.comment_tests.tests.model_tests import * -from regressiontests.comment_tests.tests.comment_form_tests import * -from regressiontests.comment_tests.tests.templatetag_tests import * -from regressiontests.comment_tests.tests.comment_view_tests import * -from regressiontests.comment_tests.tests.moderation_view_tests import * -from regressiontests.comment_tests.tests.comment_utils_moderators_tests import * +from comment_tests.tests.app_api_tests import * +from comment_tests.tests.feed_tests import * +from comment_tests.tests.model_tests import * +from comment_tests.tests.comment_form_tests import * +from comment_tests.tests.templatetag_tests import * +from comment_tests.tests.comment_view_tests import * +from comment_tests.tests.moderation_view_tests import * +from comment_tests.tests.comment_utils_moderators_tests import * diff --git a/tests/comment_tests/tests/app_api_tests.py b/tests/comment_tests/tests/app_api_tests.py index a756068790..ed23ba39cc 100644 --- a/tests/comment_tests/tests/app_api_tests.py +++ b/tests/comment_tests/tests/app_api_tests.py @@ -45,23 +45,23 @@ class CommentAppAPITests(CommentTestCase): @override_settings( - COMMENTS_APP='regressiontests.comment_tests.custom_comments', + COMMENTS_APP='comment_tests.custom_comments', INSTALLED_APPS=list(settings.INSTALLED_APPS) + [ - 'regressiontests.comment_tests.custom_comments'], + 'comment_tests.custom_comments'], ) class CustomCommentTest(CommentTestCase): - urls = 'regressiontests.comment_tests.urls' + urls = 'comment_tests.urls' def testGetCommentApp(self): - from regressiontests.comment_tests import custom_comments + from comment_tests import custom_comments self.assertEqual(comments.get_comment_app(), custom_comments) def testGetModel(self): - from regressiontests.comment_tests.custom_comments.models import CustomComment + from comment_tests.custom_comments.models import CustomComment self.assertEqual(comments.get_model(), CustomComment) def testGetForm(self): - from regressiontests.comment_tests.custom_comments.forms import CustomCommentForm + from comment_tests.custom_comments.forms import CustomCommentForm self.assertEqual(comments.get_form(), CustomCommentForm) def testGetFormTarget(self): diff --git a/tests/comment_tests/tests/feed_tests.py b/tests/comment_tests/tests/feed_tests.py index c93d7abf7d..941ffb6bf2 100644 --- a/tests/comment_tests/tests/feed_tests.py +++ b/tests/comment_tests/tests/feed_tests.py @@ -12,7 +12,7 @@ from ..models import Article class CommentFeedTests(CommentTestCase): - urls = 'regressiontests.comment_tests.urls' + urls = 'comment_tests.urls' feed_url = '/rss/comments/' def setUp(self): diff --git a/tests/comment_tests/tests/moderation_view_tests.py b/tests/comment_tests/tests/moderation_view_tests.py index c932fed2d2..02af35cfe4 100644 --- a/tests/comment_tests/tests/moderation_view_tests.py +++ b/tests/comment_tests/tests/moderation_view_tests.py @@ -252,7 +252,7 @@ class ApproveViewTests(CommentTestCase): self.assertTemplateUsed(response, "comments/approved.html") class AdminActionsTests(CommentTestCase): - urls = "regressiontests.comment_tests.urls_admin" + urls = "comment_tests.urls_admin" def setUp(self): super(AdminActionsTests, self).setUp() diff --git a/tests/conditional_processing/models.py b/tests/conditional_processing/models.py index b47fdf6fb5..77f1ff54ed 100644 --- a/tests/conditional_processing/models.py +++ b/tests/conditional_processing/models.py @@ -16,7 +16,7 @@ ETAG = 'b4246ffc4f62314ca13147c9d4f76974' EXPIRED_ETAG = '7fae4cd4b0f81e7d2914700043aa8ed6' class ConditionalGet(TestCase): - urls = 'regressiontests.conditional_processing.urls' + urls = 'conditional_processing.urls' def assertFullResponse(self, response, check_last_modified=True, check_etag=True): self.assertEqual(response.status_code, 200) diff --git a/tests/context_processors/tests.py b/tests/context_processors/tests.py index 1f2209efb0..c57c592de6 100644 --- a/tests/context_processors/tests.py +++ b/tests/context_processors/tests.py @@ -9,7 +9,7 @@ class RequestContextProcessorTests(TestCase): Tests for the ``django.core.context_processors.request`` processor. """ - urls = 'regressiontests.context_processors.urls' + urls = 'context_processors.urls' def test_request_attributes(self): """ diff --git a/tests/empty/no_models/tests.py b/tests/empty/no_models/tests.py index 6292ca9f74..8b8db1af39 100644 --- a/tests/empty/no_models/tests.py +++ b/tests/empty/no_models/tests.py @@ -2,5 +2,5 @@ from django.test import TestCase class NoModelTests(TestCase): - """ A placeholder test case. See modeltests.empty.tests for more info. """ + """ A placeholder test case. See empty.tests for more info. """ pass diff --git a/tests/empty/tests.py b/tests/empty/tests.py index 4c0c4409d8..6dd9f7c75d 100644 --- a/tests/empty/tests.py +++ b/tests/empty/tests.py @@ -31,7 +31,7 @@ class NoModelTests(TestCase): It seemed like an appropriate home for it. """ - @override_settings(INSTALLED_APPS=("modeltests.empty.no_models",)) + @override_settings(INSTALLED_APPS=("empty.no_models",)) def test_no_models(self): with six.assertRaisesRegex(self, ImproperlyConfigured, 'App with label no_models is missing a models.py module.'): diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py index 7754eb2821..5e6adee894 100644 --- a/tests/file_storage/tests.py +++ b/tests/file_storage/tests.py @@ -27,7 +27,7 @@ from django.utils import six from django.utils import unittest from django.utils._os import upath from django.test.utils import override_settings -from ..servers.tests import LiveServerBase +from servers.tests import LiveServerBase # Try to import PIL in either of the two ways it can end up installed. # Checking for the existence of Image is enough for CPython, but diff --git a/tests/forms/__init__.py b/tests/forms_tests/__init__.py similarity index 100% rename from tests/forms/__init__.py rename to tests/forms_tests/__init__.py diff --git a/tests/forms/models.py b/tests/forms_tests/models.py similarity index 100% rename from tests/forms/models.py rename to tests/forms_tests/models.py diff --git a/tests/forms/templates/forms/article_form.html b/tests/forms_tests/templates/forms/article_form.html similarity index 100% rename from tests/forms/templates/forms/article_form.html rename to tests/forms_tests/templates/forms/article_form.html diff --git a/tests/forms/tests/__init__.py b/tests/forms_tests/tests/__init__.py similarity index 100% rename from tests/forms/tests/__init__.py rename to tests/forms_tests/tests/__init__.py diff --git a/tests/forms/tests/error_messages.py b/tests/forms_tests/tests/error_messages.py similarity index 99% rename from tests/forms/tests/error_messages.py rename to tests/forms_tests/tests/error_messages.py index b76e122bc0..af047daf64 100644 --- a/tests/forms/tests/error_messages.py +++ b/tests/forms_tests/tests/error_messages.py @@ -237,7 +237,7 @@ class FormsErrorMessagesTestCase(TestCase, AssertFormErrorsMixin): class ModelChoiceFieldErrorMessagesTestCase(TestCase, AssertFormErrorsMixin): def test_modelchoicefield(self): # Create choices for the model choice field tests below. - from regressiontests.forms.models import ChoiceModel + from forms_tests.models import ChoiceModel c1 = ChoiceModel.objects.create(pk=1, name='a') c2 = ChoiceModel.objects.create(pk=2, name='b') c3 = ChoiceModel.objects.create(pk=3, name='c') diff --git a/tests/forms/tests/extra.py b/tests/forms_tests/tests/extra.py similarity index 100% rename from tests/forms/tests/extra.py rename to tests/forms_tests/tests/extra.py diff --git a/tests/forms/tests/fields.py b/tests/forms_tests/tests/fields.py similarity index 99% rename from tests/forms/tests/fields.py rename to tests/forms_tests/tests/fields.py index 3fe2cd2ace..b0e299983b 100644 --- a/tests/forms/tests/fields.py +++ b/tests/forms_tests/tests/fields.py @@ -577,7 +577,7 @@ class FieldsTests(SimpleTestCase): self.assertRaisesMessage(ValidationError, "'Enter a valid value.'", f.clean, 'abcd') # EmailField ################################################################## - # See also modeltests/validators tests for validate_email specific tests + # See also validators tests for validate_email specific tests def test_emailfield_1(self): f = EmailField() @@ -1131,7 +1131,7 @@ class FieldsTests(SimpleTestCase): f = FilePathField(path=path, allow_folders=True, allow_files=False) f.choices.sort() expected = [ - ('/tests/regressiontests/forms/tests/filepath_test_files/directory', 'directory'), + ('/tests/forms_tests/tests/filepath_test_files/directory', 'directory'), ] for exp, got in zip(expected, fix_os_paths(f.choices)): self.assertEqual(exp[1], got[1]) @@ -1140,10 +1140,10 @@ class FieldsTests(SimpleTestCase): f = FilePathField(path=path, allow_folders=True, allow_files=True) f.choices.sort() expected = [ - ('/tests/regressiontests/forms/tests/filepath_test_files/.dot-file', '.dot-file'), - ('/tests/regressiontests/forms/tests/filepath_test_files/directory', 'directory'), - ('/tests/regressiontests/forms/tests/filepath_test_files/fake-image.jpg', 'fake-image.jpg'), - ('/tests/regressiontests/forms/tests/filepath_test_files/real-text-file.txt', 'real-text-file.txt'), + ('/tests/forms_tests/tests/filepath_test_files/.dot-file', '.dot-file'), + ('/tests/forms_tests/tests/filepath_test_files/directory', 'directory'), + ('/tests/forms_tests/tests/filepath_test_files/fake-image.jpg', 'fake-image.jpg'), + ('/tests/forms_tests/tests/filepath_test_files/real-text-file.txt', 'real-text-file.txt'), ] actual = fix_os_paths(f.choices) diff --git a/tests/forms/tests/filepath_test_files/.dot-file b/tests/forms_tests/tests/filepath_test_files/.dot-file similarity index 100% rename from tests/forms/tests/filepath_test_files/.dot-file rename to tests/forms_tests/tests/filepath_test_files/.dot-file diff --git a/tests/forms/tests/filepath_test_files/directory/.keep b/tests/forms_tests/tests/filepath_test_files/directory/.keep similarity index 100% rename from tests/forms/tests/filepath_test_files/directory/.keep rename to tests/forms_tests/tests/filepath_test_files/directory/.keep diff --git a/tests/forms/tests/filepath_test_files/fake-image.jpg b/tests/forms_tests/tests/filepath_test_files/fake-image.jpg similarity index 100% rename from tests/forms/tests/filepath_test_files/fake-image.jpg rename to tests/forms_tests/tests/filepath_test_files/fake-image.jpg diff --git a/tests/forms/tests/filepath_test_files/real-text-file.txt b/tests/forms_tests/tests/filepath_test_files/real-text-file.txt similarity index 100% rename from tests/forms/tests/filepath_test_files/real-text-file.txt rename to tests/forms_tests/tests/filepath_test_files/real-text-file.txt diff --git a/tests/forms/tests/forms.py b/tests/forms_tests/tests/forms.py similarity index 100% rename from tests/forms/tests/forms.py rename to tests/forms_tests/tests/forms.py diff --git a/tests/forms/tests/formsets.py b/tests/forms_tests/tests/formsets.py similarity index 100% rename from tests/forms/tests/formsets.py rename to tests/forms_tests/tests/formsets.py diff --git a/tests/forms/tests/input_formats.py b/tests/forms_tests/tests/input_formats.py similarity index 100% rename from tests/forms/tests/input_formats.py rename to tests/forms_tests/tests/input_formats.py diff --git a/tests/forms/tests/media.py b/tests/forms_tests/tests/media.py similarity index 100% rename from tests/forms/tests/media.py rename to tests/forms_tests/tests/media.py diff --git a/tests/forms/tests/models.py b/tests/forms_tests/tests/models.py similarity index 100% rename from tests/forms/tests/models.py rename to tests/forms_tests/tests/models.py diff --git a/tests/forms/tests/regressions.py b/tests/forms_tests/tests/regressions.py similarity index 98% rename from tests/forms/tests/regressions.py rename to tests/forms_tests/tests/regressions.py index 45f51eef2f..ecee92402e 100644 --- a/tests/forms/tests/regressions.py +++ b/tests/forms_tests/tests/regressions.py @@ -7,7 +7,7 @@ from django.forms import * from django.test import TestCase from django.utils.translation import ugettext_lazy, override -from regressiontests.forms.models import Cheese +from forms_tests.models import Cheese class FormsRegressionsTestCase(TestCase): @@ -121,7 +121,7 @@ class FormsRegressionsTestCase(TestCase): f = SomeForm({'field': ['