def test_parseXHRClientRequest_raise_error_if_unknown_table(self): kwargs = { 'browTabName': 'TABLE', 'model': 'folder', } ajax_data = DummyXHRrequest(**kwargs).ajax_data() request = self.client.request() request.POST = ajax_data with self.assertRaises(ValueError): parseXHRClientRequest(request.POST)
def test_parseXHRClientRequest_if_no_model(self): kwargs = { 'browTabName': 'users_table', } ajax_data = DummyXHRrequest(**kwargs).ajax_data() request = self.client.request() request.POST = ajax_data expected = { 'browTabName': 'users_table', } self.assertEqual(parseXHRClientRequest(request.POST), expected)
def test_parseXHRClientRequest_2(self): kwargs = { 'browTabName': 'users_table', 'parent_id': None, 'sendMail': None, 'selRowIndex': '0', 'model': 'user', 'id': '1', 'name': 'fred', } ajax_data = DummyXHRrequest(**kwargs).ajax_data() request = self.client.request() request.POST = ajax_data expected = kwargs self.assertEqual(parseXHRClientRequest(request.POST), expected)