def test_state_failure(self, session):
     session.add(State(intact=False))
     session.flush()
     req = testing.DummyRequest()
     with pytest.raises(HTTPServiceUnavailable) as e:
         res = views.state_get(req)
     assert 'The server is currently unavailable' in str(e)
 def test_state(self, session):
     session.add(State(intact=True))
     session.flush()
     req = testing.DummyRequest()
     res = views.state_get(req)
     assert res == {'state': 'ok'}