From 2fe84bd5cc975d43c15736dbbea9a9dd4ce84081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aitor=20Mag=C3=A1n?= Date: Tue, 15 Jul 2014 12:59:00 +0200 Subject: [PATCH] Fix test --- ckanext/privatedatasets/tests/test_helpers.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ckanext/privatedatasets/tests/test_helpers.py b/ckanext/privatedatasets/tests/test_helpers.py index 4050b1a..b2dbd3a 100644 --- a/ckanext/privatedatasets/tests/test_helpers.py +++ b/ckanext/privatedatasets/tests/test_helpers.py @@ -56,9 +56,12 @@ class HelpersTest(unittest.TestCase): ]) def test_is_owner(self, creator_user_id, user_id, owner): # Configure test - user = MagicMock() - user.id = user_id - helpers.tk.c.userobj = user + if user_id: + user = MagicMock() + user.id = user_id + helpers.tk.c.userobj = user + else: + helpers.tk.c.userobj = None pkg_dict = {'creator_user_id': creator_user_id}