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?
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
output : Ran 0 tests in 0.001s
But after running this tox -e py27-django1.7 -- postorius.tests.test_forms
output : Ran 11 tests in 0.015s
On Fri, Feb 27, 2015 at 5:06 PM, Abhilash Raj firstname.lastname@example.org wrote:
I was able to run the tests in ListNewTest, and kind of debug the other test too.
In ListNewTest you have two tests doing the same thing, probably you intended at doing something else, but there is nothing in there right now.
there is a method of django forms called as
errors. So you can simply do
and get the actual error in the forms printed when you run the tests. When I ran that I got "Passwords are not identical" error. Then I saw you changed the
cleanmethod in UserNew to
clean_password. According to django documentation1 when you are trying to access more than one field for cleaning you have to use
cleanmethod and not
clean_emailmethod is cool!
If you print the errors for
test_form_fields_listnamemethod, you'd see that it says that 'mailman.most-desirable.org' is not a valid choice. So you need to first create a domain with that host in
I hope that helps!
On 20 February 2015 at 07:26, Pranjal Yadav email@example.com wrote:
I started writing tests to improve the coverage for postorius and I ran into few problems which I couldn't solve for past few days. I added few new test cases and re-ran tox. It seems somehow none of the tests ran although the tox output says "ran 11 tests in 72.332s, failures = 3"
After running these tests I realized UserNewTest and ListNewTest never runs, though tox outputs it ran 11 test and failed 3 (mainly the assertTrue for listname, password and email methods), when I tried tox -e py27-django1.7 -- postorius.tests.test_forms.UserNewTest, it says 0 tests ran in 0.001s
- So I don't understand why the assertTrue validation is failing though all the inputs to the form is prefect? I talked to Aurelien and Abhliash and also followed (
however it left me with the same situation.
If the tests run with tox then why do they not run when a particular testcase is tested?
I discussed this problem with Aurelien and he mentioned "Form class shouldn't do anything in its __init__ function" however we do have __inti__ functions in our forms.py. So do we need to modify something there?
-- *Pranjal Yadav*
Mailman-Developers mailing list Mailman-Developers@python.org https://mail.python.org/mailman/listinfo/mailman-developers Mailman FAQ: http://wiki.list.org/x/AgA3 Searchable Archives: http://www.mail-archive.com/mailman-developers%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-developers/raj.abhilash1%40g...
Security Policy: http://wiki.list.org/x/QIA9
-- thanks, Abhilash Raj