Esempio n. 1
0
 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'))
Esempio n. 2
0
 def test_main_table_no_author(self):
     request = construct_dummy_request()
     response = main_table(request)
     self.assertEqual(400, response.status_code)
Esempio n. 3
0
 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)
Esempio n. 4
0
 def test_main_table_no_author(self):
     request = testing.DummyRequest()
     response = main_table(request)
     self.assertEqual(400, response.status_code)