diff --git a/cms/envs/common.py b/cms/envs/common.py index 5c2adfcf06..fd75914df1 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -923,9 +923,6 @@ INSTALLED_APPS = [ # Monitor the status of services 'openedx.core.djangoapps.service_status', - # Testing - 'django_nose', - # Bookmarks 'openedx.core.djangoapps.bookmarks', diff --git a/cms/envs/test.py b/cms/envs/test.py index 051b10c293..5657ecd1b8 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -45,9 +45,6 @@ MONGO_HOST = os.environ.get('EDXAPP_TEST_MONGO_HOST', 'localhost') THIS_UUID = uuid4().hex[:5] -# Nose Test Runner -TEST_RUNNER = 'openedx.core.djangolib.nose.NoseTestSuiteRunner' - _SYSTEM = 'cms' _REPORT_DIR = REPO_ROOT / 'reports' / _SYSTEM diff --git a/lms/envs/common.py b/lms/envs/common.py index 05e207872d..b04a2b637c 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -2090,7 +2090,6 @@ INSTALLED_APPS = [ # For testing 'django.contrib.admin', # only used in DEBUG mode - 'django_nose', 'debug', 'django_extensions', diff --git a/lms/envs/test.py b/lms/envs/test.py index 9841b39976..83eb021ad4 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -91,9 +91,6 @@ PARENTAL_CONSENT_AGE_LIMIT = 13 # Makes the tests run much faster... SOUTH_TESTS_MIGRATE = False # To disable migrations and use syncdb instead -# Nose Test Runner -TEST_RUNNER = 'openedx.core.djangolib.nose.NoseTestSuiteRunner' - _SYSTEM = 'lms' _REPORT_DIR = REPO_ROOT / 'reports' / _SYSTEM diff --git a/openedx/core/djangolib/nose.py b/openedx/core/djangolib/nose.py deleted file mode 100644 index 116456ceda..0000000000 --- a/openedx/core/djangolib/nose.py +++ /dev/null @@ -1,30 +0,0 @@ -""" -Utilities related to nose. -""" -import django_nose -from django.core.management import call_command -from django.db import DEFAULT_DB_ALIAS, connections, transaction - - -class NoseTestSuiteRunner(django_nose.NoseTestSuiteRunner): - """Custom NoseTestSuiteRunner.""" - - def setup_databases(self): - """ Setup databases and then flush to remove data added by migrations. """ - return_value = super(NoseTestSuiteRunner, self).setup_databases() - - # Delete all data added by data migrations. Unit tests should setup their own data using factories. - call_command('flush', verbosity=0, interactive=False, load_initial_data=False) - - # Through Django 1.8, auto increment sequences are not reset when calling flush on a SQLite db. - # So we do it ourselves. - # http://sqlite.org/autoinc.html - connection = connections[DEFAULT_DB_ALIAS] - if connection.vendor == 'sqlite' and not connection.features.supports_sequence_reset: - with transaction.atomic(using=DEFAULT_DB_ALIAS): - cursor = connection.cursor() - cursor.execute( - "delete from sqlite_sequence;" - ) - - return return_value