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
fa623f3f
Commit
fa623f3f
authored
Aug 30, 2017
by
Jeremy Bowman
Committed by
GitHub
Aug 30, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15919 from edx/jmbowman/testcase_usage
Clean up TestCase subclassing
parents
e4deef9d
32000c7a
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 @
fa623f3f
"""
Unittests for creating a course in an chosen modulestore
"""
import
unittest
import
ddt
from
django.core.management
import
CommandError
,
call_command
from
django.test
import
TestCase
from
contentstore.management.commands.create_course
import
Command
from
xmodule.modulestore
import
ModuleStoreEnum
...
...
@@ -11,7 +11,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
xmodule.modulestore.django
import
modulestore
class
TestArgParsing
(
unittest
.
TestCase
):
class
TestArgParsing
(
TestCase
):
"""
Tests for parsing arguments for the `create_course` management command
"""
...
...
cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py
View file @
fa623f3f
"""
Unittests for migrating a course to split mongo
"""
import
unittest
from
django.core.management
import
CommandError
,
call_command
from
django.test
import
TestCase
from
contentstore.management.commands.migrate_to_split
import
Command
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
...
@@ -12,7 +11,7 @@ from xmodule.modulestore.django import modulestore
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
class
TestArgParsing
(
unittest
.
TestCase
):
class
TestArgParsing
(
TestCase
):
"""
Tests for parsing arguments for the `migrate_to_split` management command
"""
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
View file @
fa623f3f
...
...
@@ -78,7 +78,7 @@ class TestMongoModuleStoreBase(unittest.TestCase):
courses
=
[
'toy'
,
'simple'
,
'simple_with_draft'
,
'test_unicode'
]
@classmethod
def
set
u
pClass
(
cls
):
def
set
U
pClass
(
cls
):
cls
.
connection
=
pymongo
.
MongoClient
(
host
=
HOST
,
port
=
PORT
,
...
...
@@ -93,7 +93,7 @@ class TestMongoModuleStoreBase(unittest.TestCase):
cls
.
content_store
,
cls
.
draft_store
=
cls
.
initdb
()
@classmethod
def
tear
d
ownClass
(
cls
):
def
tear
D
ownClass
(
cls
):
if
cls
.
connection
:
cls
.
connection
.
drop_database
(
DB
)
cls
.
connection
.
close
()
...
...
@@ -186,12 +186,12 @@ class TestMongoModuleStore(TestMongoModuleStoreBase):
pass
@classmethod
def
set
u
pClass
(
cls
):
super
(
TestMongoModuleStore
,
cls
)
.
set
u
pClass
()
def
set
U
pClass
(
cls
):
super
(
TestMongoModuleStore
,
cls
)
.
set
U
pClass
()
@classmethod
def
tear
d
ownClass
(
cls
):
super
(
TestMongoModuleStore
,
cls
)
.
tear
d
ownClass
()
def
tear
D
ownClass
(
cls
):
super
(
TestMongoModuleStore
,
cls
)
.
tear
D
ownClass
()
def
test_init
(
self
):
'''Make sure the db loads'''
...
...
@@ -728,12 +728,12 @@ class TestMongoModuleStoreWithNoAssetCollection(TestMongoModuleStore):
pass
@classmethod
def
set
u
pClass
(
cls
):
super
(
TestMongoModuleStoreWithNoAssetCollection
,
cls
)
.
set
u
pClass
()
def
set
U
pClass
(
cls
):
super
(
TestMongoModuleStoreWithNoAssetCollection
,
cls
)
.
set
U
pClass
()
@classmethod
def
tear
d
ownClass
(
cls
):
super
(
TestMongoModuleStoreWithNoAssetCollection
,
cls
)
.
tear
d
ownClass
()
def
tear
D
ownClass
(
cls
):
super
(
TestMongoModuleStoreWithNoAssetCollection
,
cls
)
.
tear
D
ownClass
()
def
test_no_asset_collection
(
self
):
courses
=
self
.
draft_store
.
get_courses
()
...
...
openedx/core/djangoapps/content/block_structure/tests/test_factory.py
View file @
fa623f3f
"""
Tests for block_structure_factory.py
"""
from
django.test
import
TestCase
from
nose.plugins.attrib
import
attr
from
unittest
import
TestCase
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
..store
import
BlockStructureStore
...
...
openedx/core/djangoapps/content/block_structure/tests/test_manager.py
View file @
fa623f3f
...
...
@@ -2,8 +2,8 @@
Tests for manager.py
"""
import
ddt
from
django.test
import
TestCase
from
nose.plugins.attrib
import
attr
from
unittest
import
TestCase
from
..block_structure
import
BlockStructureBlockData
from
..config
import
RAISE_ERROR_WHEN_NOT_FOUND
,
STORAGE_BACKING_FOR_CACHE
,
waffle
...
...
openedx/core/djangoapps/user_api/tests/test_middleware.py
View file @
fa623f3f
"""Tests for user API middleware"""
from
mock
import
Mock
,
patch
from
unittest
import
TestCase
from
django.http
import
HttpResponse
from
django.test
import
TestCase
from
django.test.client
import
RequestFactory
from
student.tests.factories
import
UserFactory
,
AnonymousUserFactory
...
...
openedx/core/djangoapps/user_api/tests/test_partition_schemes.py
View file @
fa623f3f
...
...
@@ -2,8 +2,8 @@
Test the user api's partition extensions.
"""
from
collections
import
defaultdict
from
django.test
import
TestCase
from
mock
import
patch
from
unittest
import
TestCase
from
openedx.core.djangoapps.user_api.partition_schemes
import
RandomUserPartitionScheme
,
UserPartitionError
from
student.tests.factories
import
UserFactory
...
...
openedx/core/djangoapps/util/tests/test_user_messages.py
View file @
fa623f3f
...
...
@@ -3,10 +3,9 @@ Unit tests for user messages.
"""
import
ddt
from
unittest
import
TestCase
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
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