Example #1
0
 def setUp(self):
     create_users(self)
     
     # Every test needs a client.
     self.client = Client()
     self.response = self.client.get(self.url)
     self.assertTrue(User.objects.all().count() > 0)
Example #2
0
 def setUp(self):
     create_users(self)
     self.user = User.objects.get(pk=1)
     self.url = reverse(self.view, args=(self.user.username,))
     self.assertTrue(
         self.client.login(username=self.user.username,
                           password=self.user.username))
     self.response = self.client.get(self.url)