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 test_string_conversion(self): user = User(username='******', name='Kyle Fuller') self.assertEqual(str(user), 'Kyle Fuller (kyle)')
def get_user(self): return User('kyle', 'Kyle Fuller')
def get_user(self): response = self.get('myself', allow_redirects=False) response.raise_for_status() return User.from_json(response.json())
def get_user(self): response = self.get('myself') return User.from_json(response.json())