Tuesday, December 13, 2011

Django testing and unique=True

Hi,
I have a problem with model testing. My test fails with error:
IntegrityError: duplicate key value violates unique constraint
"catalog_name_key"
DETAIL: Key (name)=(test_catalog1) already exists.

I have unique=True on name field.

class CatalogTestCase(unittest.TestCase):
def setUp(self):
self.catalog1 = Catalog.objects.create(name="test_catalog1",
title_ru="Test Catalog1")

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate