Commits

fcoelho committed 20d5192

more tests

  • Participants
  • Parent commits 1ab33cd

Comments (0)

Files changed (3)

signup/tests/templates/registration/activation_email.txt

+-- title=subject
+Subject
+-- title=txt
+Text

signup/tests/templates/registration/signup_complete.html

Empty file added.

signup/tests/test_views.py

 class SignUpTests(TestCase):
 	def test_signup_get(self):
 		url = reverse('signup_signup')
-		response = self.client.get(url)
-		self.assertEquals(response.status_code, 200)
-		self.assertTemplateUsed(response, 'registration/signup_form.html')
-		
+		r = self.client.get(url)
+		self.assertEquals(r.status_code, 200)
+		self.assertTemplateUsed(r, 'registration/signup_form.html')
+
+	def test_signup_post_default_user_model(self):
+		url = reverse('signup_signup')
+		r = self.client.post(url, {
+			'username': 'alice',
+			'email': 'alice@bob.com',
+			'password1': 'alicepass',
+			'password2': 'alicepass'
+		})
+		self.assertRedirects(r, reverse('signup_signup_complete'))
+
 	def test_form_class_default(self):
 		url = reverse('signup_signup')
 		r = self.client.get(url)
 		self.assertIsInstance(r.context['form'], DefaultUserCreationForm)
-	
+
 	@override_settings(SIGNUP_FORM_CLASS='signup.tests.AlternateSignupForm')
 	def test_form_class_alternate(self):
 		url = reverse('signup_signup')
 		r = self.client.get(url)
 		self.assertIsInstance(r.context['form'], AlternateSignupForm)
 
-	
+	def test_signup_complete(self):
+		url = reverse('signup_signup_complete')
+		r = self.client.get(url)
+		self.assertEquals(r.status_code, 200)
+		self.assertTemplateUsed(r, 'registration/signup_complete.html')
+