def test_update_login(self, mock_update):
        canvas = Users()

        user_id = 188885
        logins = canvas.get_user_logins(user_id)

        login = logins[0]
        login.unique_id = "testid99new"
        login.sis_user_id = ""

        canvas.update_user_login(login, account_id=12345)
        mock_update.assert_called_with(
            '/api/v1/accounts/12345/logins/100',
            {'login': {'sis_user_id': '', 'unique_id': 'testid99new'}})
Exemplo n.º 2
0
    def test_update_login(self, mock_update):
        canvas = Users()

        user_id = 188885
        logins = canvas.get_user_logins(user_id)

        login = logins[0]
        login.unique_id = "testid99new"
        login.sis_user_id = ""

        canvas.update_user_login(login, account_id=12345)
        mock_update.assert_called_with(
            '/api/v1/accounts/12345/logins/100',
            {'login': {'sis_user_id': '', 'unique_id': 'testid99new'}})

        with override_settings(RESTCLIENTS_CANVAS_ACCOUNT_ID=None):
            canvas = Users()
            self.assertRaises(
                MissingAccountID, canvas.update_user_login, login)