diff mbox

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

Message ID 1435654329-19960-9-git-send-email-stephen.finucane@intel.com
State Superseded
Headers show

Commit Message

Stephen Finucane June 30, 2015, 8:52 a.m. UTC
The 'link' view was not being tested. Resolve this with tests for all
paths.

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

Comments

Damien Lespiau Aug. 19, 2015, 1:43 p.m. UTC | #1
On Tue, Jun 30, 2015 at 09:52:06AM +0100, Stephen Finucane wrote:
> The 'link' view was not being tested. Resolve this with tests for all
> paths.
> 
> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>

You're moving the init of a few members to __init__(), reformatting a
line and adding a new blank line at the end (again those spurious
changes) but I'm missing what is problably obvious to you: what does it
change so it does what you say in the commit message?
Stephen Finucane Aug. 19, 2015, 1:57 p.m. UTC | #2
> On Tue, Jun 30, 2015 at 09:52:06AM +0100, Stephen Finucane wrote:
> > The 'link' view was not being tested. Resolve this with tests for all
> > paths.
> >
> > Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
> 
> You're moving the init of a few members to __init__(), reformatting a
> line and adding a new blank line at the end (again those spurious
> changes) but I'm missing what is problably obvious to you: what does it
> change so it does what you say in the commit message?

This looks like a rebase mistake - there should be a load of additional tests in here :/ I'll fix in v2.

> --
> Damien
> 
> > ---
> >  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@example.com'
> > -    secondary_email = 'test2@example.com'
> > -    password = None
> >
> > -    def __init__(self):
> > +    def __init__(self, username='testuser', email='test@example.com',
> > +                 secondary_email='test2@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
> >
> > _______________________________________________
> > Patchwork mailing list
> > Patchwork@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/patchwork
diff mbox

Patch

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@example.com'
-    secondary_email = 'test2@example.com'
-    password = None
 
-    def __init__(self):
+    def __init__(self, username='testuser', email='test@example.com',
+                 secondary_email='test2@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):