'Test error message if user name or email is missing.'

def test_missing_username_and_email_error(self):

    self.certificate_invalidation_data.update({'user': ''})
    response = self.client.post(self.url, data=json.dumps(self.certificate_invalidation_data), content_type='application/json')
    self.assertEqual(response.status_code, 400)
    res_json = json.loads(response.content)
    self.assertEqual(res_json['message'], u'Student    username/email    field    is    required    and    can    not    be    empty.    Kindly    fill    in    username/email    and    then    press    "Invalidate    Certificate"    button.')
