Example #1
0
def assert_form_errors(response, *errors):
    """Given a response, assert that only the given `errors`
    are present in the form response."""

    efe = expected_form_errors = set(errors)
    assert set(form_errors(response).keys()) - efe == set()
Example #2
0
def assert_form_errors(response, *errors):
    """Given a response, assert that only the given `errors`
    are present in the form response."""

    efe = expected_form_errors = set(errors)
    assert set(form_errors(response).keys()) - efe == set()
Example #3
0
 def test_add_project_no_name(self):
     response = self.post('base:add_project',
                          {'description': 'cats cats cats'})
     assert 'This field is required.' in form_errors(response)['name']
Example #4
0
 def test_add_project_no_name(self):
     response = self.post('base:add_project',
         {'description': 'cats cats cats'})
     assert 'This field is required.' in form_errors(response)['name']