hi, I have a test like this:
self.assertRaises(ValidationError,Costtocompany.objects.create,profile=self.profile1, company_laptop = True, ctc_pa=1, ctc_pm =1, laptop_sno = '', datefrom = self.dfrom) this model has a clean() method that works when I save from admin, but is not called when I run the test: def clean(self): """ if laptop then sno otherwise no sno. If if company_car - make and regno """ if self.company_laptop == True: if self.laptop_sno == '': raise ValidationError(_("Fill in laptop serial number")) the message I get from the test is: Traceback (most recent call last): File "/home/lawgon/servicefirst/employee/tests.py", line 42, in testCosttocompanyvalidation datefrom = self.dfrom) AssertionError: ValidationError not raised any clues? -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.