3
0
Fork 0

test: fix pylint warnings for FunctionalTestCase

This commit is contained in:
Lance Edgar 2025-12-28 23:01:58 -06:00
parent 3af8e8aaf2
commit 53817a9e32

View file

@ -179,13 +179,17 @@ class VersionWebTestCase(WebTestCase):
@pytest.mark.functional
class FunctionalTestCase(DataTestCase):
"""
Base class for test suites requiring a fully complete web app, to
respond to functional tests.
Base class for test suites requiring a fully complete web app, for
sake of functional tests.
.. warning::
This class is very new and not yet mature; it will surely change.
"""
wsgi_main_app = None
def make_config(self, **kwargs):
def make_config(self, **kwargs): # pylint: disable=arguments-differ
sqlite_path = self.write_file("test.sqlite", "")
self.sqlite_engine_url = f"sqlite:///{sqlite_path}"
@ -203,14 +207,14 @@ version_locations = wuttjamaican.db:alembic/versions
return super().make_config([config_path], **kwargs)
def make_webtest(self):
def make_webtest(self): # pylint: disable=missing-function-docstring
webapp = appmod.make_wsgi_app(
self.wsgi_main_app or appmod.main, config=self.config
)
return TestApp(webapp)
def get_csrf_token(self, testapp):
def get_csrf_token(self, testapp): # pylint: disable=missing-function-docstring
res = testapp.get("/login")
match = re.search(
r'<input name="_csrf" type="hidden" value="(\w+)" />', res.text