@patch('bedrock.mozorg.views.requests.post')
def test_sf_form_proxy_invalid_form(self, post_patch):
    'A form error should result in a 400 response.'
    with self.activate('en-US'):
        url = reverse('mozorg.partnerships')
        resp = self.client.post(url, {'first_name': ('Dude' * 20)}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    self.assertEqual(resp.status_code, 400)
    resp_data = simplejson.loads(resp.content)
    self.assertEqual(resp_data['msg'], 'Form invalid')
    self.assertFalse(post_patch.called)
A form error should result in a 400 response.
@patch('bedrock.mozorg.views.requests.post')
def test_sf_form_proxy_invalid_form(self, post_patch):
    
    with self.activate('en-US'):
        url = reverse('mozorg.partnerships')
        resp = self.client.post(url, {'first_name': ('Dude' * 20)}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    self.assertEqual(resp.status_code, 400)
    resp_data = simplejson.loads(resp.content)
    self.assertEqual(resp_data['msg'], 'Form invalid')
    self.assertFalse(post_patch.called)