def test_page_error4(self): self.config.testing_securitypolicy(userid='Tobias', permissive=True) request = construct_dummy_request(matchdict={'uid': 'a'}) try: user(request) except HTTPNotFound: pass
def test_page(self): db_user = DBDiscussionSession.query(User).filter_by(nickname='Tobias').first() request = construct_dummy_request(matchdict={'uid': db_user.uid}) response = user(request) verify_dictionary_of_view(response) self.assertIn('user', response) self.assertIn('can_send_notification', response) self.assertFalse(response['can_send_notification'])
def test_page_other(self): self.config.testing_securitypolicy(userid='Tobias', permissive=True) db_user = DBDiscussionSession.query(User).filter_by(nickname='Christian').first() request = construct_dummy_request(matchdict={'uid': db_user.uid}) response = user(request) verify_dictionary_of_view(response) self.assertIn('user', response) self.assertIn('can_send_notification', response) self.assertTrue(response['can_send_notification'])