Sunday, October 27, 2013

Duplicating production data for specific TestCase

I need an actual data created by users in my special TestCase class. Django automatically create another database and execute syndb command which loads data into multiple tables (contenttypes, auth_permissions etc.) and fixtures and when I try to import my dump in setUp() method, it conflicts with the initial data.
I took a look at default DjangoTestSuiteRunner class but overriding this class in my settings doesn't seem like a good idea because it also uses different functions from different files for creating files (django.db.backends) and when I override DjangoTestSuiteRunner create_test_db method, it may cause problems for other TestCases in my project.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/dbb955dc-3a1a-4f81-91b0-307b1357cf90%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment