Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
32000c7a
Commit
32000c7a
authored
Aug 29, 2017
by
Jeremy Bowman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up TestCase subclassing
parent
f42e6f1c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
19 additions
and
21 deletions
+19
-21
cms/djangoapps/contentstore/management/commands/tests/test_create_course.py
+2
-2
cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py
+2
-3
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
+10
-10
openedx/core/djangoapps/content/block_structure/tests/test_factory.py
+1
-1
openedx/core/djangoapps/content/block_structure/tests/test_manager.py
+1
-1
openedx/core/djangoapps/user_api/tests/test_middleware.py
+1
-1
openedx/core/djangoapps/user_api/tests/test_partition_schemes.py
+1
-1
openedx/core/djangoapps/util/tests/test_user_messages.py
+1
-2
No files found.
cms/djangoapps/contentstore/management/commands/tests/test_create_course.py
View file @
32000c7a
"""
"""
Unittests for creating a course in an chosen modulestore
Unittests for creating a course in an chosen modulestore
"""
"""
import
unittest
import
ddt
import
ddt
from
django.core.management
import
CommandError
,
call_command
from
django.core.management
import
CommandError
,
call_command
from
django.test
import
TestCase
from
contentstore.management.commands.create_course
import
Command
from
contentstore.management.commands.create_course
import
Command
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore
import
ModuleStoreEnum
...
@@ -11,7 +11,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
...
@@ -11,7 +11,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
class
TestArgParsing
(
unittest
.
TestCase
):
class
TestArgParsing
(
TestCase
):
"""
"""
Tests for parsing arguments for the `create_course` management command
Tests for parsing arguments for the `create_course` management command
"""
"""
...
...
cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py
View file @
32000c7a
"""
"""
Unittests for migrating a course to split mongo
Unittests for migrating a course to split mongo
"""
"""
import
unittest
from
django.core.management
import
CommandError
,
call_command
from
django.core.management
import
CommandError
,
call_command
from
django.test
import
TestCase
from
contentstore.management.commands.migrate_to_split
import
Command
from
contentstore.management.commands.migrate_to_split
import
Command
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
@@ -12,7 +11,7 @@ from xmodule.modulestore.django import modulestore
...
@@ -12,7 +11,7 @@ from xmodule.modulestore.django import modulestore
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
class
TestArgParsing
(
unittest
.
TestCase
):
class
TestArgParsing
(
TestCase
):
"""
"""
Tests for parsing arguments for the `migrate_to_split` management command
Tests for parsing arguments for the `migrate_to_split` management command
"""
"""
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
View file @
32000c7a
...
@@ -78,7 +78,7 @@ class TestMongoModuleStoreBase(unittest.TestCase):
...
@@ -78,7 +78,7 @@ class TestMongoModuleStoreBase(unittest.TestCase):
courses
=
[
'toy'
,
'simple'
,
'simple_with_draft'
,
'test_unicode'
]
courses
=
[
'toy'
,
'simple'
,
'simple_with_draft'
,
'test_unicode'
]
@classmethod
@classmethod
def
set
u
pClass
(
cls
):
def
set
U
pClass
(
cls
):
cls
.
connection
=
pymongo
.
MongoClient
(
cls
.
connection
=
pymongo
.
MongoClient
(
host
=
HOST
,
host
=
HOST
,
port
=
PORT
,
port
=
PORT
,
...
@@ -93,7 +93,7 @@ class TestMongoModuleStoreBase(unittest.TestCase):
...
@@ -93,7 +93,7 @@ class TestMongoModuleStoreBase(unittest.TestCase):
cls
.
content_store
,
cls
.
draft_store
=
cls
.
initdb
()
cls
.
content_store
,
cls
.
draft_store
=
cls
.
initdb
()
@classmethod
@classmethod
def
tear
d
ownClass
(
cls
):
def
tear
D
ownClass
(
cls
):
if
cls
.
connection
:
if
cls
.
connection
:
cls
.
connection
.
drop_database
(
DB
)
cls
.
connection
.
drop_database
(
DB
)
cls
.
connection
.
close
()
cls
.
connection
.
close
()
...
@@ -186,12 +186,12 @@ class TestMongoModuleStore(TestMongoModuleStoreBase):
...
@@ -186,12 +186,12 @@ class TestMongoModuleStore(TestMongoModuleStoreBase):
pass
pass
@classmethod
@classmethod
def
set
u
pClass
(
cls
):
def
set
U
pClass
(
cls
):
super
(
TestMongoModuleStore
,
cls
)
.
set
u
pClass
()
super
(
TestMongoModuleStore
,
cls
)
.
set
U
pClass
()
@classmethod
@classmethod
def
tear
d
ownClass
(
cls
):
def
tear
D
ownClass
(
cls
):
super
(
TestMongoModuleStore
,
cls
)
.
tear
d
ownClass
()
super
(
TestMongoModuleStore
,
cls
)
.
tear
D
ownClass
()
def
test_init
(
self
):
def
test_init
(
self
):
'''Make sure the db loads'''
'''Make sure the db loads'''
...
@@ -728,12 +728,12 @@ class TestMongoModuleStoreWithNoAssetCollection(TestMongoModuleStore):
...
@@ -728,12 +728,12 @@ class TestMongoModuleStoreWithNoAssetCollection(TestMongoModuleStore):
pass
pass
@classmethod
@classmethod
def
set
u
pClass
(
cls
):
def
set
U
pClass
(
cls
):
super
(
TestMongoModuleStoreWithNoAssetCollection
,
cls
)
.
set
u
pClass
()
super
(
TestMongoModuleStoreWithNoAssetCollection
,
cls
)
.
set
U
pClass
()
@classmethod
@classmethod
def
tear
d
ownClass
(
cls
):
def
tear
D
ownClass
(
cls
):
super
(
TestMongoModuleStoreWithNoAssetCollection
,
cls
)
.
tear
d
ownClass
()
super
(
TestMongoModuleStoreWithNoAssetCollection
,
cls
)
.
tear
D
ownClass
()
def
test_no_asset_collection
(
self
):
def
test_no_asset_collection
(
self
):
courses
=
self
.
draft_store
.
get_courses
()
courses
=
self
.
draft_store
.
get_courses
()
...
...
openedx/core/djangoapps/content/block_structure/tests/test_factory.py
View file @
32000c7a
"""
"""
Tests for block_structure_factory.py
Tests for block_structure_factory.py
"""
"""
from
django.test
import
TestCase
from
nose.plugins.attrib
import
attr
from
nose.plugins.attrib
import
attr
from
unittest
import
TestCase
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
..store
import
BlockStructureStore
from
..store
import
BlockStructureStore
...
...
openedx/core/djangoapps/content/block_structure/tests/test_manager.py
View file @
32000c7a
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
Tests for manager.py
Tests for manager.py
"""
"""
import
ddt
import
ddt
from
django.test
import
TestCase
from
nose.plugins.attrib
import
attr
from
nose.plugins.attrib
import
attr
from
unittest
import
TestCase
from
..block_structure
import
BlockStructureBlockData
from
..block_structure
import
BlockStructureBlockData
from
..config
import
RAISE_ERROR_WHEN_NOT_FOUND
,
STORAGE_BACKING_FOR_CACHE
,
waffle
from
..config
import
RAISE_ERROR_WHEN_NOT_FOUND
,
STORAGE_BACKING_FOR_CACHE
,
waffle
...
...
openedx/core/djangoapps/user_api/tests/test_middleware.py
View file @
32000c7a
"""Tests for user API middleware"""
"""Tests for user API middleware"""
from
mock
import
Mock
,
patch
from
mock
import
Mock
,
patch
from
unittest
import
TestCase
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.test
import
TestCase
from
django.test.client
import
RequestFactory
from
django.test.client
import
RequestFactory
from
student.tests.factories
import
UserFactory
,
AnonymousUserFactory
from
student.tests.factories
import
UserFactory
,
AnonymousUserFactory
...
...
openedx/core/djangoapps/user_api/tests/test_partition_schemes.py
View file @
32000c7a
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
Test the user api's partition extensions.
Test the user api's partition extensions.
"""
"""
from
collections
import
defaultdict
from
collections
import
defaultdict
from
django.test
import
TestCase
from
mock
import
patch
from
mock
import
patch
from
unittest
import
TestCase
from
openedx.core.djangoapps.user_api.partition_schemes
import
RandomUserPartitionScheme
,
UserPartitionError
from
openedx.core.djangoapps.user_api.partition_schemes
import
RandomUserPartitionScheme
,
UserPartitionError
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
...
...
openedx/core/djangoapps/util/tests/test_user_messages.py
View file @
32000c7a
...
@@ -3,10 +3,9 @@ Unit tests for user messages.
...
@@ -3,10 +3,9 @@ Unit tests for user messages.
"""
"""
import
ddt
import
ddt
from
unittest
import
TestCase
from
django.contrib.messages.middleware
import
MessageMiddleware
from
django.contrib.messages.middleware
import
MessageMiddleware
from
django.test
import
RequestFactory
from
django.test
import
RequestFactory
,
TestCase
from
openedx.core.djangolib.markup
import
HTML
,
Text
from
openedx.core.djangolib.markup
import
HTML
,
Text
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment