In unit tests i need to load few fixtures  i have done as below

   class TestQuestionBankViews(TestCase):

        #load this fixtures
        fixtures = ['qbank',]

        def setUp(self):
            login = self.client.login
(email="m...@gmail.com",password="welcome")


        def test_starting_an_exam_view(self):
            candidate = Candidate.objects.get(email="m...@gmail.com")
            .......etc


        def test_review_view(self):
            self.assertTrue(True)
            .........

       def test_review_view2(self):
            self.assertTrue(True)
            ............

Problem:

These fixtures are loading for every test (i.e) before
test_review_view, test_review_view2 etc... as django flushes the
database after every test

How can i prevent that as it is taking lots of time?

Can't i load in setUp and flush them out while exit but not between
every test and still inheriting django.test.TestCase ?

I can do this using unittest.TestCase but i could not able to  access
all the convenient methods like
 assertTemplateUsed , assertTemplateNotUsed , assertFormError etc..

Hope the problem is clear

One more thing i felt is:
a.In django.test.TestCase it would be good if user has the provision
to say whether he want database flush after
every test case or not.

b.Also there should very good line of separation between
initialization of object vs initialization before every method
  at present setUp method trying to do both the things


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to