Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)