Esempio n. 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())
 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)
Esempio n. 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)
Esempio n. 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())
 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())
Esempio n. 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())
Esempio n. 7
0
 def setUp(self):
     self.user = UserFactory.create()
     self.data = self.get_valid_data()
     self.url = reverse(self.url_name)
Esempio n. 8
0
 def setUp(self):
     self.user = UserFactory.create()
     self.data = self.get_valid_data()
     self.url = reverse(self.url_name)