Commit 3dee61ec by John Eskew Committed by GitHub

Merge pull request #16342 from edx/jeskew/again_more_django_111_changes

More Django 1.11 startup changes - remove django-nose and more.
parents 2fafa546 f28542d3
......@@ -13,7 +13,6 @@ from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.core.files import File
from django.core.servers.basehttp import FileWrapper
from django.db import transaction
from django.http import Http404, HttpResponse, HttpResponseNotFound
from django.utils.translation import ugettext as _
......@@ -25,6 +24,7 @@ from path import Path as path
from six import text_type
from user_tasks.conf import settings as user_tasks_settings
from user_tasks.models import UserTaskArtifact, UserTaskStatus
from wsgiref.util import FileWrapper
from contentstore.storage import course_import_export_storage
from contentstore.tasks import CourseExportTask, CourseImportTask, create_export_tarball, export_olx, import_olx
......
......@@ -923,9 +923,6 @@ INSTALLED_APPS = [
# Monitor the status of services
'openedx.core.djangoapps.service_status',
# Testing
'django_nose',
# Bookmarks
'openedx.core.djangoapps.bookmarks',
......
......@@ -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
......
......@@ -2090,7 +2090,6 @@ INSTALLED_APPS = [
# For testing
'django.contrib.admin', # only used in DEBUG mode
'django_nose',
'debug',
'django_extensions',
......
......@@ -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
......
"""
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
......@@ -205,6 +205,3 @@ py2neo==3.1.2
# Support for plugins
web-fragments==0.2.2
xblock==1.0.0
# Third Party XBlocks
edx-sga==0.6.4
......@@ -61,6 +61,7 @@ git+https://github.com/mitodl/django-cas.git@47cfef16cbbf305f943cceb8c0b02514194
# back to master when and if this fix is merged back.
# fs==0.4.0
git+https://github.com/edx/pyfs.git@96e1922348bfe6d99201b9512a9ed946c87b7e0b#egg=fs==0.4.0
# The officially released version of django-debug-toolbar-mongo doesn't support DJDT 1.x. This commit does.
git+https://github.com/hmarr/django-debug-toolbar-mongo.git@b0686a76f1ce3532088c4aee6e76b9abe61cc808#egg=django-debug-toolbar-mongo==0.1.10
......@@ -89,7 +90,7 @@ git+https://github.com/edx/django-celery.git@f87c6f914a1410463f54aebf68458c0653b
-e git+https://github.com/edx/codejail.git@a320d43ce6b9c93b17636b2491f724d9e433be47#egg=codejail==0.0
-e git+https://github.com/edx/django-splash.git@v0.2#egg=django-splash==0.2
-e git+https://github.com/edx/acid-block.git@e46f9cda8a03e121a00c7e347084d142d22ebfb7#egg=acid-xblock
git+https://github.com/edx/edx-ora2.git@2.1.2#egg=ora2==2.1.2
git+https://github.com/edx/edx-ora2.git@2.1.3#egg=ora2==2.1.3
git+https://github.com/edx/RecommenderXBlock.git@0e744b393cf1f8b886fe77bc697e7d9d78d65cd6#egg=recommender-xblock==1.2
git+https://github.com/solashirai/crowdsourcehinter.git@518605f0a95190949fe77bd39158450639e2e1dc#egg=crowdsourcehinter-xblock==0.1
-e git+https://github.com/edx/RateXBlock.git@367e19c0f6eac8a5f002fd0f1559555f8e74bfff#egg=rate-xblock
......@@ -102,5 +103,8 @@ git+https://github.com/edx/xblock-lti-consumer.git@v1.1.6#egg=lti_consumer-xbloc
git+https://github.com/edx/edx-proctoring.git@1.2.3#egg=edx-proctoring==1.2.3
# Third Party XBlocks
# Move the edx-sga xblock requirement back to base.txt and onto the upstream version after these changes are merged upstream.
git+https://github.com/doctoryes/edx-sga.git@c20a8a8e259ef7d5da6394d9f67549200bbb46ee#egg=edx-sga==0.0
git+https://github.com/open-craft/xblock-poll@7ba819b968fe8faddb78bb22e1fe7637005eb414#egg=xblock-poll==1.2.7
git+https://github.com/edx-solutions/xblock-drag-and-drop-v2@v2.0.18#egg=xblock-drag-and-drop-v2==2.0.18
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment