![](https://secure.gravatar.com/avatar/fa76c3359215a1dc6ca0d11aee3c9824.jpg?s=120&d=mm&r=g)
Abhilash,
Thanks! it worked as you said. But renaming clean method is not conventional. I changed the names and it looks like 'clean_password_repeat' is good and that is the last input for that test as well, so I don't understand why but that works.
The 'except' part for 'clean_email' is not functioning as expected and I have already written the validation tests for that part as well. On 28 Feb 2015 09:53, "Abhilash Raj" <raj.abhilash1@gmail.com> wrote:
On 27 February 2015 at 20:39, Pranjal Yadav <godricglow@gmail.com> wrote:
Hi Abhilash,
Thanks for your help. I read that we need to define methods as clean_<fieldname> however I missed I was cleaning multiple fields. For the listname method it works the way you told me but I tried something similar ( http://pastebin.com/p40A19hU ) and it didn't work. If you could tell me why is that?
The list that you pass in choices is a list of 'tuples' which has 2 elements in it. The first is the choice to be displayed in the 'dropdown' and second is its value.
So you have to do something like this:
self.domain_choices =
[('mailman.most-desirable.org','mailman.most-desirable.org')]
and then call the ListNew class like this:
form = ListNew(self.domain_choices, self.form_data)
Also I'm still puzzled when I run tox -e py27-django1.7 -- postorius.tests.test_forms.UserNewTest tox -e py27-django1.7 -- postorius.tests.test_forms.ListNewTest tox -e py27-django1.7 -- postorius.tests.test_forms.DomainNewTest
Its not the correct way to run the individual test cases in django, it is little different from nose. You can run
$ tox -e py27-django1.7 -- postorius.test.test_forms:ListNewTest
-- thanks, Abhilash Raj