Skip to content
This repository
Browse code

Reworked profile tests for Travis

  • Loading branch information...
commit fd87c728d872747bda65d44b6f5249b0d98e2eab 1 parent 69045ac
David Winterbottom authored April 26, 2012

Showing 1 changed file with 15 additions and 4 deletions. Show diff stats Hide diff stats

  1. 19  oscar/apps/customer/tests.py
19  oscar/apps/customer/tests.py
@@ -68,11 +68,22 @@ def test_404_received_for_order_with_incorrect_hash(self):
68 68
 
69 69
 
70 70
 class EditProfileTests(TestCase):
  71
+    username = 'customer'
  72
+    password = 'cheeseshop'
  73
+    email = 'customer@example.com'
71 74
 
72  
-    def test_change_password_page_returns_200(self):
73  
-        User.objects.create_user(username='customer',
74  
-                                 email='customer@example.com', password='')
75  
-        self.client.login(username='customer', password='')
  75
+    def setUp(self):
  76
+        User.objects.create_user(username=self.username,
  77
+                                 email=self.email, password=self.password)
  78
+        is_successful = self.client.login(username=self.username, 
  79
+                                          password=self.password)
  80
+        if not is_successful:
  81
+            self.fail("Unable to login as %s" % self.username)
  82
+
  83
+    def tearDown(self):
  84
+        User.objects.all().delete()
  85
+
  86
+    def test_update_profile_page_for_smoke(self):
76 87
         url = reverse('customer:profile-update')
77 88
         response = self.client.get(url)
78 89
         self.assertEqual(200, response.status_code)

0 notes on commit fd87c72

Please sign in to comment.
Something went wrong with that request. Please try again.