38 lines
987 B
Python
38 lines
987 B
Python
"""Страница /unloading — kiosk guard."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import unittest
|
|
|
|
from app import create_app, db
|
|
from app.services.setup_state import mark_setup_complete
|
|
from tests.helpers.zootech_test_helpers import ZootechTestConfig, drain_response
|
|
|
|
|
|
class UnloadingPageServedConfig(ZootechTestConfig):
|
|
pass
|
|
|
|
|
|
class UnloadingPageServedTests(unittest.TestCase):
|
|
def setUp(self) -> None:
|
|
self.app = create_app(UnloadingPageServedConfig)
|
|
self.client = self.app.test_client()
|
|
self.ctx = self.app.app_context()
|
|
self.ctx.push()
|
|
db.create_all()
|
|
mark_setup_complete(self.app)
|
|
|
|
def tearDown(self) -> None:
|
|
db.session.remove()
|
|
db.drop_all()
|
|
self.ctx.pop()
|
|
|
|
def test_unloading_localhost_returns_200(self) -> None:
|
|
resp = self.client.get("/unloading")
|
|
self.assertEqual(resp.status_code, 200)
|
|
drain_response(resp)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|