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
a4bf549a
Commit
a4bf549a
authored
Oct 07, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use assertIsInstance instead of assertTrue(type(x) == y)
parent
9103fa39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
common/lib/xmodule/xmodule/tests/test_annotatable_module.py
+4
-4
lms/djangoapps/bulk_email/tests/test_err_handling.py
+3
-3
No files found.
common/lib/xmodule/xmodule/tests/test_annotatable_module.py
View file @
a4bf549a
...
...
@@ -52,7 +52,7 @@ class AnnotatableModuleTestCase(unittest.TestCase):
actual_attr
=
self
.
annotatable
.
_get_annotation_data_attr
(
0
,
el
)
self
.
assert
True
(
type
(
actual_attr
)
is
dict
)
self
.
assert
IsInstance
(
actual_attr
,
dict
)
self
.
assertDictEqual
(
expected_attr
,
actual_attr
)
def
test_annotation_class_attr_default
(
self
):
...
...
@@ -62,7 +62,7 @@ class AnnotatableModuleTestCase(unittest.TestCase):
expected_attr
=
{
'class'
:
{
'value'
:
'annotatable-span highlight'
}
}
actual_attr
=
self
.
annotatable
.
_get_annotation_class_attr
(
0
,
el
)
self
.
assert
True
(
type
(
actual_attr
)
is
dict
)
self
.
assert
IsInstance
(
actual_attr
,
dict
)
self
.
assertDictEqual
(
expected_attr
,
actual_attr
)
def
test_annotation_class_attr_with_valid_highlight
(
self
):
...
...
@@ -78,7 +78,7 @@ class AnnotatableModuleTestCase(unittest.TestCase):
}
actual_attr
=
self
.
annotatable
.
_get_annotation_class_attr
(
0
,
el
)
self
.
assert
True
(
type
(
actual_attr
)
is
dict
)
self
.
assert
IsInstance
(
actual_attr
,
dict
)
self
.
assertDictEqual
(
expected_attr
,
actual_attr
)
def
test_annotation_class_attr_with_invalid_highlight
(
self
):
...
...
@@ -92,7 +92,7 @@ class AnnotatableModuleTestCase(unittest.TestCase):
}
actual_attr
=
self
.
annotatable
.
_get_annotation_class_attr
(
0
,
el
)
self
.
assert
True
(
type
(
actual_attr
)
is
dict
)
self
.
assert
IsInstance
(
actual_attr
,
dict
)
self
.
assertDictEqual
(
expected_attr
,
actual_attr
)
def
test_render_annotation
(
self
):
...
...
lms/djangoapps/bulk_email/tests/test_err_handling.py
View file @
a4bf549a
...
...
@@ -61,7 +61,7 @@ class TestEmailErrors(ModuleStoreTestCase):
self
.
assertTrue
(
retry
.
called
)
(
_
,
kwargs
)
=
retry
.
call_args
exc
=
kwargs
[
'exc'
]
self
.
assert
True
(
type
(
exc
)
==
SMTPDataError
)
self
.
assert
IsInstance
(
exc
,
SMTPDataError
)
@patch
(
'bulk_email.tasks.get_connection'
,
autospec
=
True
)
@patch
(
'bulk_email.tasks.course_email_result'
)
...
...
@@ -110,7 +110,7 @@ class TestEmailErrors(ModuleStoreTestCase):
self
.
assertTrue
(
retry
.
called
)
(
_
,
kwargs
)
=
retry
.
call_args
exc
=
kwargs
[
'exc'
]
self
.
assert
True
(
type
(
exc
)
==
SMTPServerDisconnected
)
self
.
assert
IsInstance
(
exc
,
SMTPServerDisconnected
)
@patch
(
'bulk_email.tasks.get_connection'
,
autospec
=
True
)
@patch
(
'bulk_email.tasks.course_email.retry'
)
...
...
@@ -131,7 +131,7 @@ class TestEmailErrors(ModuleStoreTestCase):
self
.
assertTrue
(
retry
.
called
)
(
_
,
kwargs
)
=
retry
.
call_args
exc
=
kwargs
[
'exc'
]
self
.
assert
True
(
type
(
exc
)
==
SMTPConnectError
)
self
.
assert
IsInstance
(
exc
,
SMTPConnectError
)
@patch
(
'bulk_email.tasks.course_email_result'
)
@patch
(
'bulk_email.tasks.course_email.retry'
)
...
...
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