def test_confirm_email_address_with_unknown_token(self): verification_token = create_confirmation_token(self.user.id) verification_token.token = '879fa007-5fbc-412e-8ec1-b7f140807631' self.assertFalse(self.user.enabled) response = self._confirm(verification_token) self.assertEqual(response.status_code, 404) self.assertFalse(self.user.enabled)
def test_confirm_email_address_with_unknown_token(self): verification_token = create_confirmation_token(self.user.id) verification_token.token = 'wZdSLzkT-zRf2x2T6AR7yGa3Nc_X3Nn3F3XGPvPtOhw' assert not self.user.enabled response = self._confirm(verification_token) assert response.status_code == 404 assert not self.user.enabled
def test_confirm_email_address_with_unknown_token(self): verification_token = create_confirmation_token(self.user.id) verification_token.token = '879fa007-5fbc-412e-8ec1-b7f140807631' assert not self.user.enabled response = self._confirm(verification_token) assert response.status_code == 404 assert not self.user.enabled
def test_confirm_email_address_with_valid_token(self): verification_token = create_confirmation_token(self.user.id) self.db.session.add(verification_token) self.db.session.commit() self.assertFalse(self.user.enabled) response = self._confirm(verification_token) self.assertEqual(response.status_code, 302) self.assertTrue(self.user.enabled)
def test_confirm_email_address_with_valid_token(self): verification_token = create_confirmation_token(self.user.id) self.db.session.add(verification_token) self.db.session.commit() assert not self.user.enabled response = self._confirm(verification_token) assert response.status_code == 302 assert self.user.enabled
def test_confirm_email_address_with_unknown_token(self): verification_token = create_confirmation_token(self.user.id) verification_token.token = 'wZdSLzkT-zRf2x2T6AR7yGa3Nc_X3Nn3F3XGPvPtOhw' # -------------------------------- # response = self._confirm(verification_token) # -------------------------------- # assert response.status_code == 404 assert not self.user.initialized assert _get_role_ids(self.user.id) == set()
def test_confirm_email_address_with_valid_token(self): authorization_service.create_role('board_user', 'Board User') verification_token = create_confirmation_token(self.user.id) self.db.session.add(verification_token) self.db.session.commit() # -------------------------------- # response = self._confirm(verification_token) # -------------------------------- # assert response.status_code == 302 assert self.user.initialized assert _get_role_ids(self.user.id) == {'board_user'}