def test_no_trip_type(self): """For trips without a trip_type, we use program.""" circus_trip = factories.TripFactory.build( trip_type=enums.TripType.NONE.value, program=enums.Program.CIRCUS.value) self.assertEqual( icons.for_trip(circus_trip), '<i class="fa fa-fw fa-users" title="Circus"></i>', ) cabin_trip = factories.TripFactory.build( trip_type=enums.TripType.OTHER.value, program=enums.Program.CABIN.value) self.assertEqual(icons.for_trip(cabin_trip), '<i class="fa fa-fw fa-home" title="Cabin"></i>')
def test_trip_type(self): skating_trip = factories.TripFactory.build( trip_type=enums.TripType.ICE_SKATING.value, program=enums.Program.WINTER_SCHOOL.value, ) self.assertEqual( icons.for_trip(skating_trip), '<i class="fa fa-fw fa-skating" title="Ice skating"></i>', )
def test_regular_icon(self): """Some icons will use FontAwesome 'regular' over solid.""" climbing_trip = factories.TripFactory.build( trip_type=enums.TripType.GYM_CLIMBING.value, program=enums.Program.CLIMBING.value, ) self.assertEqual( icons.for_trip(climbing_trip), '<i class="far fa-fw fa-hand-rock" title="Gym climbing"></i>', )
def trip_icon(trip): return icons.for_trip(trip)
def test_no_icon(self): """Without sufficient information, no icon can be rendered.""" misc_trip = factories.TripFactory.build( trip_type=enums.TripType.OTHER.value, program=enums.Program.NONE.value) self.assertEqual(icons.for_trip(misc_trip), '')