From b7e929e9dd6e0e84d9afbb44a77a64b675442c70 Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Mon, 4 May 2020 08:48:37 +0200 Subject: [PATCH] Add patch to test --- server/registration/mutations_public.py | 1 - server/registration/tests/test_registration.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/registration/mutations_public.py b/server/registration/mutations_public.py index b36ad5e4..603e9564 100644 --- a/server/registration/mutations_public.py +++ b/server/registration/mutations_public.py @@ -36,7 +36,6 @@ class Registration(relay.ClientIDMutation): try: hep_client.customer_activate(confirmation_key, user_id) user_data = hep_client.customers_by_id(admin_token, user_id) - # double check if user has verified his email. If the "confirmation" field is present, the email address # is not verified. Note that the user should not be able to see this page without verified email. if 'confirmation' in user_data: diff --git a/server/registration/tests/test_registration.py b/server/registration/tests/test_registration.py index 7e28f970..4baf4f2b 100644 --- a/server/registration/tests/test_registration.py +++ b/server/registration/tests/test_registration.py @@ -69,9 +69,10 @@ class RegistrationTests(TestCase): self.assertTrue(result.get('data').get('registration').get('success')) self.assertEqual(result.get('data').get('registration').get('message'), 'no_valid_license') - @patch.object(HepClient, 'customers_by_id', return_value=INVALID_KEY_ME) @patch.object(HepClient, 'customer_activate', return_value="Response") - def test_user_cannot_register_with_invalid_key(self, id_mock, confirmation_mock): + @patch.object(HepClient, 'customers_by_id', return_value=INVALID_KEY_ME) + @patch.object(HepClient, 'fetch_admin_token', return_value=b'"AABBCCDDEE**44566"') + def test_user_cannot_register_with_invalid_key(self, admin_mock, confirmation_mock, id_mock): result = self.make_register_mutation('CONFIRMATION_KEY', 1)