You are raising a dict style ValidationError. To get the actual fields you
need to use the_exception.error_dict[’note’].error_list[0].code.
> On Jul 30, 2015, at 4:10 AM, ThomasTheDjangoFan
> wrote:
>
> class TestMyNotebookModelTest(unittest):
> def test_clean(self):
> # I'd lov
Hi Jordi,
thanks a lot for your response!
Yeah definetly, BUT this error message could change during development and
I guess that is the reason why the django-docs recon you to set
error_codes. This why you wouldn't have to touch the tests when changing
the error-message but keeping the error
An easy way is to test that the rendered form has the error message raised
suring rhe validation.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+u
Hi guys,
I got a working model.clean() method that actually does a great job showing
the errors in the assigned html-form. *The view actually marks single
invalid fields red, which I find really important*.
*BUT:*
Now I want to *write a test* for that model and would love to *test for
error_co
4 matches
Mail list logo