def test_user_creation_from_json(self): json = { 'name': 'kyle', 'emailAddress': '*****@*****.**', 'displayName': 'Kyle Fuller', } user = User.from_json(json) self.assertEqual(user.username, 'kyle') self.assertEqual(user.name, 'Kyle Fuller') self.assertEqual(user.email, '*****@*****.**')
def get_user(self): response = self.get('myself') return User.from_json(response.json())
def get_user(self): response = self.get('myself', allow_redirects=False) response.raise_for_status() return User.from_json(response.json())