示例#1
0
    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))
示例#2
0
    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))
示例#3
0
 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))
示例#4
0
 def test_get_user_no_params(self):
     self.assertRaises(ValueError, lambda: get_user(object))