def test_get_plant_types_display_returns_plant_types_in_alphabetical_order( self, mock_plant_types): mock_plant_types = ['c', 'b', 'a'] mock_garden = create_autospec(Garden) type(mock_garden).plant_types = mock_plant_types formatter = GardenFormatter(mock_garden) ret_val = formatter.get_plant_types_display() assert ret_val == 'a, b, c'
def test_get_plant_types_diplay(self, mock_plant_types, plant_types, expected): mock_plant_types.return_value = plant_types mock_garden = create_autospec(Garden) type(mock_garden).plant_types = mock_plant_types formatter = GardenFormatter(mock_garden) ret_val = formatter.get_plant_types_display() assert ret_val == expected