test_get_frontend_sessions.py 624 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. from q3stats.testing import BaseQ3StatsWebAppTestCase
  3. class Test_GetFrontendSessions(BaseQ3StatsWebAppTestCase):
  4. def test_ok(self):
  5. with self.app.test_request_context():
  6. rsp = self.client.get('/sessions/')
  7. assert rsp.status_code == 302
  8. assert rsp.headers['Location'].endswith('/#/sessions/')
  9. def test_ok_with_day(self):
  10. with self.app.test_request_context():
  11. rsp = self.client.get('/sessions/2017-02-14')
  12. assert rsp.status_code == 302
  13. assert rsp.headers['Location'].endswith('/#/sessions/2017-02-14')