Improve PEP8 test_html.py

This commit is contained in:
Richard Vézina committed 2016-03-14 15:02:40 -04:00
1 parent b7a0f2043c
commit 983627daa4
1 file changed
+4 -1
+4 -1
View File
@@ -343,14 +343,17 @@ class TestBareHelpers(unittest.TestCase):
request.controller = 'c' request.controller = 'c'
request.function = 'f' request.function = 'f'
request.env = {} request.env = {}
from globals import current
from globals import current # TODO: Check if this import can go at the top of the file with other imports
current.request = request current.request = request
must_return = '/a/c/f' must_return = '/a/c/f'
self.assertEqual(URL(), must_return) self.assertEqual(URL(), must_return)
self.assertEqual(URL('f'), must_return) self.assertEqual(URL('f'), must_return)
self.assertEqual(URL('c', 'f'), must_return) self.assertEqual(URL('c', 'f'), must_return)
self.assertEqual(URL('a', 'c', 'f'), must_return) self.assertEqual(URL('a', 'c', 'f'), must_return)
self.assertEqual(URL('a', 'c', 'f', extension='json'), '/a/c/f.json') self.assertEqual(URL('a', 'c', 'f', extension='json'), '/a/c/f.json')
def weird(): def weird():
pass pass
self.assertEqual(URL('a', 'c', weird), '/a/c/weird') self.assertEqual(URL('a', 'c', weird), '/a/c/weird')