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
9103fa39
Commit
9103fa39
authored
Oct 07, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use assertIsInstance.
parent
3af6b90b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
cms/djangoapps/contentstore/tests/test_contentstore.py
+1
-1
common/djangoapps/service_status/test.py
+2
-2
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
+3
-3
common/lib/xmodule/xmodule/tests/test_error_module.py
+4
-4
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
9103fa39
...
...
@@ -792,7 +792,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
source_location
.
tag
,
source_location
.
org
,
source_location
.
course
,
'html'
,
'nonportable'
])
html_module
=
module_store
.
get_instance
(
source_location
.
course_id
,
html_module_location
)
self
.
assert
True
(
isinstance
(
html_module
.
data
,
basestring
)
)
self
.
assert
IsInstance
(
html_module
.
data
,
basestring
)
new_data
=
html_module
.
data
.
replace
(
'/static/'
,
'/c4x/{0}/{1}/asset/'
.
format
(
source_location
.
org
,
source_location
.
course
))
module_store
.
update_item
(
html_module_location
,
new_data
)
...
...
common/djangoapps/service_status/test.py
View file @
9103fa39
...
...
@@ -42,6 +42,6 @@ class CeleryConfigTest(unittest.TestCase):
# We don't know the other dict values exactly,
# but we can assert that they take the right form
self
.
assert
True
(
isinstance
(
result_dict
[
'task_id'
],
unicode
)
)
self
.
assert
True
(
isinstance
(
result_dict
[
'time'
],
float
)
)
self
.
assert
IsInstance
(
result_dict
[
'task_id'
],
unicode
)
self
.
assert
IsInstance
(
result_dict
[
'time'
],
float
)
self
.
assertTrue
(
result_dict
[
'time'
]
>
0.0
)
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
View file @
9103fa39
...
...
@@ -769,10 +769,10 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
self
.
assertEqual
(
module
.
current_task_number
,
0
)
html
=
module
.
get_html
()
self
.
assert
True
(
isinstance
(
html
,
basestring
)
)
self
.
assert
IsInstance
(
html
,
basestring
)
rubric
=
module
.
handle_ajax
(
"get_combined_rubric"
,
{})
self
.
assert
True
(
isinstance
(
rubric
,
basestring
)
)
self
.
assert
IsInstance
(
rubric
,
basestring
)
self
.
assertEqual
(
module
.
state
,
"assessing"
)
module
.
handle_ajax
(
"reset"
,
{})
self
.
assertEqual
(
module
.
current_task_number
,
0
)
...
...
@@ -790,7 +790,7 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
#Simulate a student saving an answer
module
.
handle_ajax
(
"save_answer"
,
{
"student_answer"
:
self
.
answer
})
status
=
module
.
handle_ajax
(
"get_status"
,
{})
self
.
assert
True
(
isinstance
(
status
,
basestring
)
)
self
.
assert
IsInstance
(
status
,
basestring
)
#Mock a student submitting an assessment
assessment_dict
=
MockQueryDict
()
...
...
common/lib/xmodule/xmodule/tests/test_error_module.py
View file @
9103fa39
...
...
@@ -29,7 +29,7 @@ class TestErrorModule(unittest.TestCase, SetupTestErrorModules):
def
test_error_module_xml_rendering
(
self
):
descriptor
=
error_module
.
ErrorDescriptor
.
from_xml
(
self
.
valid_xml
,
self
.
system
,
self
.
org
,
self
.
course
,
self
.
error_msg
)
self
.
assert
True
(
isinstance
(
descriptor
,
error_module
.
ErrorDescriptor
)
)
self
.
assert
IsInstance
(
descriptor
,
error_module
.
ErrorDescriptor
)
module
=
descriptor
.
xmodule
(
self
.
system
)
context_repr
=
module
.
get_html
()
self
.
assertIn
(
self
.
error_msg
,
context_repr
)
...
...
@@ -43,7 +43,7 @@ class TestErrorModule(unittest.TestCase, SetupTestErrorModules):
error_descriptor
=
error_module
.
ErrorDescriptor
.
from_descriptor
(
descriptor
,
self
.
error_msg
)
self
.
assert
True
(
isinstance
(
error_descriptor
,
error_module
.
ErrorDescriptor
)
)
self
.
assert
IsInstance
(
error_descriptor
,
error_module
.
ErrorDescriptor
)
module
=
error_descriptor
.
xmodule
(
self
.
system
)
context_repr
=
module
.
get_html
()
self
.
assertIn
(
self
.
error_msg
,
context_repr
)
...
...
@@ -60,7 +60,7 @@ class TestNonStaffErrorModule(unittest.TestCase, SetupTestErrorModules):
def
test_non_staff_error_module_create
(
self
):
descriptor
=
error_module
.
NonStaffErrorDescriptor
.
from_xml
(
self
.
valid_xml
,
self
.
system
,
self
.
org
,
self
.
course
)
self
.
assert
True
(
isinstance
(
descriptor
,
error_module
.
NonStaffErrorDescriptor
)
)
self
.
assert
IsInstance
(
descriptor
,
error_module
.
NonStaffErrorDescriptor
)
def
test_from_xml_render
(
self
):
descriptor
=
error_module
.
NonStaffErrorDescriptor
.
from_xml
(
...
...
@@ -78,7 +78,7 @@ class TestNonStaffErrorModule(unittest.TestCase, SetupTestErrorModules):
error_descriptor
=
error_module
.
NonStaffErrorDescriptor
.
from_descriptor
(
descriptor
,
self
.
error_msg
)
self
.
assert
True
(
isinstance
(
error_descriptor
,
error_module
.
ErrorDescriptor
)
)
self
.
assert
IsInstance
(
error_descriptor
,
error_module
.
ErrorDescriptor
)
module
=
error_descriptor
.
xmodule
(
self
.
system
)
context_repr
=
module
.
get_html
()
self
.
assertNotIn
(
self
.
error_msg
,
context_repr
)
...
...
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