def test_location_factory(self): location = Location.from_pickup_address( 'Tenaya Hall, San Diego, CA 92161') location_dict = { 'locationCategory': "user", 'coordinates': { 'latitude': 32.8794203, 'longitude': -117.2428555 }, 'address': 'Tenaya Hall, San Diego, CA 92161', } self.assertDictEqual(location.to_dict(), location_dict)
def testPickupAddress(self): location = Location.from_pickup_address( "Tenaya Hall, San Diego, CA 92161") d = location.to_dict() self.assertEqual( d, { 'locationCategory': "user", 'coordinates': { 'latitude': 32.8794203, 'longitude': -117.2428555 }, 'address': 'Tenaya Hall, San Diego, CA 92161', })
def testGetUserLocation(self): location = Location.from_pickup_address( "Tenaya Hall, San Diego, CA 92161") ref = LocationGenericDao().insert_new(location) self.to_delete.append(ref) location = LocationGenericDao().get(ref) d = location.to_dict() self.assertEqual( d, { 'locationCategory': "user", 'coordinates': { 'latitude': 32.8794203, 'longitude': -117.2428555 }, 'address': 'Tenaya Hall, San Diego, CA 92161', })