예제 #1
0
 def test_post_authenticated(self):
     self.login_user(UserFactory.create())
     response = self._post(url=self.url, data=self.data)
     # import pdb; pdb.set_trace()
     self.assertEquals(response.status_code, 302)
     suggestions = Resource.objects.all()
     self.assertEqual(1, suggestions.count())
예제 #2
0
 def test_get_authenticated(self):
     """Authenticated users can view add suggestion page."""
     self.login_user(UserFactory.create())
     response = self._get(url=self.url)
     self.assertEquals(response.status_code, 200)
     self.assertTemplateUsed(response, self.template_name)
     self.failUnless('form' in response.context)
예제 #3
0
 def test_get_authenticated(self):
     """Authenticated users can view add resource page."""
     self.login_user(UserFactory.create())
     response = self._get(url=self.url)
     self.assertEquals(response.status_code, 200)
     self.assertTemplateUsed(response, self.template_name)
     self.failUnless('form' in response.context)
예제 #4
0
 def test_post_authenticated(self):
     self.login_user(UserFactory.create())
     response = self._post(url=self.url, data=self.data)
     # import pdb; pdb.set_trace()
     self.assertEquals(response.status_code, 302)
     suggestions = Resource.objects.all()
     self.assertEqual(1, suggestions.count())
예제 #5
0
 def test_post_authenticated(self):
     """Authenticated users can add suggestions."""
     data = self.get_valid_data()
     self.login_user(UserFactory.create())
     response = self._post(url=self.url, data=data)
     self.assertEquals(response.status_code, 302)
     suggestions = Request.objects.all()
     self.assertEqual(1, suggestions.count())
예제 #6
0
 def test_post_authenticated(self):
     """Authenticated users can add suggestions."""
     data = self.get_valid_data()
     self.login_user(UserFactory.create())
     response = self._post(url=self.url, data=data)
     self.assertEquals(response.status_code, 302)
     suggestions = Request.objects.all()
     self.assertEqual(1, suggestions.count())
예제 #7
0
 def setUp(self):
     self.user = UserFactory.create()
     self.data = self.get_valid_data()
     self.url = reverse(self.url_name)
예제 #8
0
 def setUp(self):
     self.user = UserFactory.create()
     self.data = self.get_valid_data()
     self.url = reverse(self.url_name)