def test_get_user(self): user = G(OnlineUser) self.assertEqual(user, get_user(user, ow4=True)) self.assertEqual(user.online_mail, get_user(user, gsuite=True)) self.assertEqual(user, get_user(user.online_mail, ow4=True)) self.assertEqual(user.online_mail, get_user(user.online_mail, gsuite=True))
def test_get_user(self): user = G( OnlineUser, first_name="Test", last_name="Testesen", online_mail="test.testesen", ) self.assertEqual(user, get_user(user, ow4=True)) self.assertEqual(user.online_mail, get_user(user, gsuite=True)) self.assertEqual(user, get_user(user.online_mail, ow4=True)) self.assertEqual(user.online_mail, get_user(user.online_mail, gsuite=True))
def test_get_onlineuser_not_exist(self, mocked_logger): email = f"{self.user}@{self.domain}" self.assertRaises(OnlineUser.DoesNotExist, lambda: get_user(email, ow4=True)) mocked_logger.assert_called_with( 'User "{user}" does not exist on OW4!'.format(user=email))
def test_get_user_no_params(self): self.assertRaises(ValueError, lambda: get_user(object))