@@ -16,16 +16,17 @@ class BasicTest(TestCase):
1616 class TestWithException (SmokeTest ):
1717 def test_fail (self ):
1818 self .assertTrue (False , BasicTest ._FAIL_MSG )
19+
1920 def test_with_exception (self ):
2021 raise Exception (BasicTest ._EXC_MSG )
22+
2123 def dir (self ):
2224 """ Overvrite dir method so test_fail would be before
2325 test_with_exception for sure.
2426
2527 """
2628 return ['test_fail' , 'test_with_exception' ]
2729
28-
2930 def setUp (self ):
3031 settings .INSTALLED_APPS = ('main' , 'smoketest' )
3132 self .c = Client ()
@@ -52,6 +53,10 @@ def test_basics(self):
5253 TestFailedSmokeTests .CUSTOM_TEST_MSG ,
5354 response .content .decode ('utf-8' ))
5455
56+ def test_extendable (self ):
57+ response = self .c .get ("/extendable/" )
58+ self .assertEqual (response .status_code , 500 )
59+
5560 def test_json (self ):
5661 " Testing JSON response. "
5762 json_content_type = 'application/json'
@@ -77,7 +82,6 @@ def test_json(self):
7782 TestFailedSmokeTests .CUSTOM_TEST_MSG ,
7883 response_obj ['failed_tests' ])
7984
80-
8185 def test_error (self ):
8286 " Tests the error case (when we got exception during the smoke test). "
8387 test = self .TestWithException ()
@@ -86,14 +90,14 @@ def test_error(self):
8690 self .assertEqual (1 , errored )
8791 self .assertEqual (errored , len (e_tests ))
8892 self .assertIn (
89- "TestWithException.test_with_exception errored: %s" %
90- BasicTest ._EXC_MSG ,
91- e_tests [0 ])
93+ "TestWithException.test_with_exception errored: %s" %
94+ BasicTest ._EXC_MSG ,
95+ e_tests [0 ])
9296 self .assertNotIn (BasicTest ._FAIL_MSG , e_tests [0 ])
9397
94-
9598 def test_logging (self ):
96- " On failure and on errors, messages should be logged by setup method. "
99+ """ On failure and on errors, messages should be logged by setup method.
100+ """
97101 _logged_msgs = []
98102
99103 def logger_mock (msg ):
@@ -108,13 +112,13 @@ def __init__(self):
108112
109113 TestForLogging ().run ()
110114
111- # After this, both fail and error message should be logged (should be in
112- # _looged_msgs array).
115+ # After this, both fail and error message should be logged
116+ # (should be in _looged_msgs array).
113117 self .assertEqual (2 , len (_logged_msgs ))
114118 # As stated in TestWithException, the fake test will be the first for
115119 # sure.
116120 self .assertIn (BasicTest ._FAIL_MSG , _logged_msgs [0 ])
117121 self .assertIn (
118- "TestForLogging.test_with_exception errored: %s" %
119- BasicTest ._EXC_MSG ,
120- _logged_msgs [1 ])
122+ "TestForLogging.test_with_exception errored: %s" %
123+ BasicTest ._EXC_MSG ,
124+ _logged_msgs [1 ])
0 commit comments