From a71ef51c443aa44a7a97bfd8df3ef222b3ec147a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 07 2017 10:19:30 +0000 Subject: Fix the FakeUser object to the groups are always re-created Signed-off-by: Pierre-Yves Chibon --- diff --git a/tests/__init__.py b/tests/__init__.py index 6297aa4..521316b 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -337,7 +337,7 @@ class FakeGroup(object): # pylint: disable=too-few-public-methods class FakeUser(object): # pylint: disable=too-few-public-methods """ Fake user used to test the fedocallib library. """ - def __init__(self, groups=[], username='username', cla_done=True, id=1): + def __init__(self, groups=None, username='username', cla_done=True, id=1): """ Constructor. :arg groups: list of the groups in which this fake user is supposed to be. @@ -345,7 +345,7 @@ class FakeUser(object): # pylint: disable=too-few-public-methods if isinstance(groups, basestring): groups = [groups] self.id = id - self.groups = groups + self.groups = groups or [] self.user = username self.username = username self.name = username