def test_entity_collections(self): a = model.Athlete() d = {'clubs': [{'resource_state': 2, 'id': 7, 'name': 'Team Roaring Mouse'}, {'resource_state': 2, 'id': 1, 'name': 'Team Strava Cycling'}, {'resource_state': 2, 'id': 34444, 'name': 'Team Strava Cyclocross'}] } a.from_dict(d) self.assertEquals(3, len(a.clubs)) self.assertEquals('Team Roaring Mouse', a.clubs[0].name)
def test_detailed_resource_state_means_true(self): a = model.Athlete() a.resource_state = attributes.DETAILED self.assertTrue(a.is_authenticated_athlete())
def test_caching(self): a = model.Athlete() a._is_authenticated = "Not None" self.assertEqual(a.is_authenticated_athlete(), "Not None")