Skip to content
test_auth.py 85.7 KiB
Newer Older
                'sn': (expected_last,),
            }
Dong Zhuang's avatar
Dong Zhuang committed
            user = backend.update_user(user, user_attribute, saml_attribute_mapping)
            self.assertEqual(user.first_name, expected_first)
            self.assertEqual(user.last_name, expected_last)
            self.assertTrue(user.name_verified)
            self.assertEqual(user.status, constants.user_status.active)
            self.assertTrue(user.institutional_id_verified)

            with mock.patch("accounts.models.User.save") as mock_save:
                # no changes
                backend.update_user(user, user_attribute, saml_attribute_mapping)
                self.assertEqual(mock_save.call_count, 0)
Dong Zhuang's avatar
Dong Zhuang committed

Dong Zhuang's avatar
Dong Zhuang committed
# vim: foldmethod=marker