def test_main_table(self): self.config.testing_securitypolicy(userid='Tobias', permissive=True) request = construct_dummy_request(matchdict={'table': 'User'}) response = main_table(request) self.assertIn('title', response) self.assertIn('project', response) self.assertIn('extras', response) self.assertIsNotNone(response['table'].get('name')) self.assertIsNotNone(response['table'].get('has_elements')) self.assertIsNotNone(response['table'].get('count')) self.assertIsNotNone(response['table'].get('head')) self.assertIsNotNone(response['table'].get('row'))
def test_main_table_no_author(self): request = construct_dummy_request() response = main_table(request) self.assertEqual(400, response.status_code)
def test_main_table_error(self): self.config.testing_securitypolicy(userid='Tobias', permissive=True) request = construct_dummy_request(matchdict={'table': 'fu'}) response = main_table(request) self.assertEqual(400, response.status_code)
def test_main_table_no_author(self): request = testing.DummyRequest() response = main_table(request) self.assertEqual(400, response.status_code)