|
|
@ -255,17 +255,17 @@ class BasicFunctionalityTestCase(unittest.TestCase): |
|
|
|
== '/static/index.html' |
|
|
|
== '/static/index.html' |
|
|
|
|
|
|
|
|
|
|
|
def test_none_response(self): |
|
|
|
def test_none_response(self): |
|
|
|
warnings.filterwarnings('error', 'View function did not return') |
|
|
|
|
|
|
|
app = flask.Flask(__name__) |
|
|
|
app = flask.Flask(__name__) |
|
|
|
@app.route('/') |
|
|
|
@app.route('/') |
|
|
|
def test(): |
|
|
|
def test(): |
|
|
|
return None |
|
|
|
return None |
|
|
|
try: |
|
|
|
try: |
|
|
|
app.test_client().get('/') |
|
|
|
app.test_client().get('/') |
|
|
|
except Warning: |
|
|
|
except ValueError, e: |
|
|
|
|
|
|
|
assert str(e) == 'View function did not return a response' |
|
|
|
pass |
|
|
|
pass |
|
|
|
else: |
|
|
|
else: |
|
|
|
assert "Expected warning" |
|
|
|
assert "Expected ValueError" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class JSONTestCase(unittest.TestCase): |
|
|
|
class JSONTestCase(unittest.TestCase): |
|
|
|