def test_emails_are_not_sent_went_database_is_read_only(self): larry = self.make_participant('larry') self.queue_email(larry, 'team_invite', team='team', team_url='fake_url', inviter='bob') with postgres_readonly(self.db): Participant.dequeue_emails() assert self.mailer.call_count == 0 assert self.db.one("SELECT email_status FROM notifications") == 'queued'
def test_sign_in_when_db_is_read_only(self): with postgres_readonly(self.db): r = self.sign_in(HTTP_ACCEPT=b'text/html') assert r.code == 503, r.text assert 'read-only' in r.text