def test_get_station_or_system(self): station_id = self.station.station_id location_name, location_obj = get_station_or_system(station_id) self.assertEqual(location_name, 'station') solar_system_id = self.solar_system.solar_system_id location_name, location_obj = get_station_or_system(solar_system_id) self.assertEqual(location_name, 'solar_system')
def prepare(self, asset): type_id = asset['item_type_id'] location_id = asset['location_id'] item = Item.objects.get(type_id=type_id) location, location_obj = get_station_or_system(location_id) prepped = { 'character': self.char, 'item': item, location: location_obj, 'unique_item_id': asset['id'], 'quantity': asset['quantity'], 'flag': asset['location_flag'], 'packaged': asset['packaged'], } return prepped