示例#1
0
 def test_unexpected_param(self):
     resp = Mock()
     response = rest.login(resp, app_id='1', token='t', hook='h', foo='foo')
     errors = {'errors': {'params': 'Unexpected param(s): foo'}}
     self.assert_can_serialize_as_json(response)
     self.assertDictEqual(errors, response.context)
     self.assertEqual(400, resp.status_code)
示例#2
0
 def test_unexpected_param(self):
     resp = Mock()
     response = rest.login(resp, app_id='1', token='t', hook='h', foo='foo')
     errors = {'errors': {'params': 'Unexpected param(s): foo'}}
     self.assert_can_serialize_as_json(response)
     self.assertDictEqual(errors, response.context)
     self.assertEqual(400, resp.status_code)
示例#3
0
 def test_mandatory_field_not_present(self):
     resp = Mock()
     response = rest.login(resp, app_id='1')
     errors = {'errors': {'params': 'Missing param(s): hook, token'}}
     self.assert_can_serialize_as_json(response)
     self.assertDictEqual(errors, response.context)
     self.assertEqual(400, resp.status_code)
示例#4
0
 def test_mandatory_field_not_present(self):
     resp = Mock()
     response = rest.login(resp, app_id='1')
     errors = {'errors': {'params': 'Missing param(s): hook, token'}}
     self.assert_can_serialize_as_json(response)
     self.assertDictEqual(errors, response.context)
     self.assertEqual(400, resp.status_code)