fix: format all code with black
and from now on should not deviate from that...
This commit is contained in:
parent
8a09fb1a3c
commit
4d0693862d
68 changed files with 6693 additions and 5659 deletions
|
@ -11,7 +11,7 @@ from wuttaweb.testing import WebTestCase
|
|||
class TestWuttaWebContinuumPlugin(WebTestCase):
|
||||
|
||||
def setUp(self):
|
||||
if not hasattr(mod, 'WuttaWebContinuumPlugin'):
|
||||
if not hasattr(mod, "WuttaWebContinuumPlugin"):
|
||||
pytest.skip("test not relevant without sqlalchemy-continuum")
|
||||
self.setup_web()
|
||||
|
||||
|
@ -21,17 +21,17 @@ class TestWuttaWebContinuumPlugin(WebTestCase):
|
|||
def test_get_remote_addr(self):
|
||||
plugin = self.make_plugin()
|
||||
|
||||
with patch.object(mod, 'get_current_request', return_value=None):
|
||||
with patch.object(mod, "get_current_request", return_value=None):
|
||||
self.assertIsNone(plugin.get_remote_addr(None, self.session))
|
||||
|
||||
self.request.client_addr = '127.0.0.1'
|
||||
self.assertEqual(plugin.get_remote_addr(None, self.session), '127.0.0.1')
|
||||
self.request.client_addr = "127.0.0.1"
|
||||
self.assertEqual(plugin.get_remote_addr(None, self.session), "127.0.0.1")
|
||||
|
||||
def test_get_user_id(self):
|
||||
plugin = self.make_plugin()
|
||||
|
||||
with patch.object(mod, 'get_current_request', return_value=None):
|
||||
with patch.object(mod, "get_current_request", return_value=None):
|
||||
self.assertIsNone(plugin.get_user_id(None, self.session))
|
||||
|
||||
self.request.user = MagicMock(uuid='some-random-uuid')
|
||||
self.assertEqual(plugin.get_user_id(None, self.session), 'some-random-uuid')
|
||||
self.request.user = MagicMock(uuid="some-random-uuid")
|
||||
self.assertEqual(plugin.get_user_id(None, self.session), "some-random-uuid")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue