[PATCH 08/11] tests/test_user: Add "profile unlink" tests

Stephen Finucane stephen.finucane at intel.com
Tue Jun 30 18:52:06 AEST 2015


The 'link' view was not being tested. Resolve this with tests for all
paths.

Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
---
 patchwork/tests/test_user.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/patchwork/tests/test_user.py b/patchwork/tests/test_user.py
index d9aef7e..46e6d09 100644
--- a/patchwork/tests/test_user.py
+++ b/patchwork/tests/test_user.py
@@ -30,15 +30,16 @@ def _confirmation_url(conf):
     return reverse('patchwork.views.confirm', kwargs = {'key': conf.key})
 
 class TestUser(object):
-    username = 'testuser'
-    email = 'test at example.com'
-    secondary_email = 'test2 at example.com'
-    password = None
 
-    def __init__(self):
+    def __init__(self, username='testuser', email='test at example.com',
+                 secondary_email='test2 at example.com'):
+        self.username = username
+        self.email = email
+        self.secondary_email = secondary_email
         self.password = User.objects.make_random_password()
-        self.user = User.objects.create_user(self.username,
-                            self.email, self.password)
+        self.user = User.objects.create_user(
+            self.username, self.email, self.password)
+
 
 class UserPersonRequestTest(TestCase):
     def setUp(self):
-- 
2.0.0



More information about the Patchwork mailing list