mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 18:23:18 -04:00 
			
		
		
		
	* cleanup oversized buttons * add get all by category function to reciep repos * fix shopping-list can_merge logic * use randomized data for testing * add random getter to repository for meal-planner * add stub route for random meals * cleanup global namespace * add rules database type * fix type * add plan rules schema * test plan rules methods * add mealplan rules controller * add new repository * update frontend types * formatting * fix regression * update autogenerated types * add api class for mealplan rules * add tests and fix bugs * fix data returns * proof of concept rules editor * add tag support * remove old group categories * add tag support * implement random by rules api * change snack to sides * remove incorrect typing * split repo for custom methods * fix query and use and_ clause * use repo function * remove old test * update changelog
		
			
				
	
	
		
			21 lines
		
	
	
		
			655 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			655 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from datetime import datetime
 | |
| 
 | |
| import pytest
 | |
| 
 | |
| from mealie.schema.meal_plan.plan_rules import PlanRulesDay
 | |
| 
 | |
| test_cases = [
 | |
|     (datetime(2022, 2, 7), PlanRulesDay.monday),
 | |
|     (datetime(2022, 2, 8), PlanRulesDay.tuesday),
 | |
|     (datetime(2022, 2, 9), PlanRulesDay.wednesday),
 | |
|     (datetime(2022, 2, 10), PlanRulesDay.thursday),
 | |
|     (datetime(2022, 2, 11), PlanRulesDay.friday),
 | |
|     (datetime(2022, 2, 12), PlanRulesDay.saturday),
 | |
|     (datetime(2022, 2, 13), PlanRulesDay.sunday),
 | |
| ]
 | |
| 
 | |
| 
 | |
| @pytest.mark.parametrize("date, expected", test_cases)
 | |
| def test_date_obj_to_enum(date: datetime, expected: PlanRulesDay):
 | |
|     assert PlanRulesDay.from_date(date) == expected
 |