from django.test import TestCase
from django.contrib.auth.models import User
from .models import Journee, Repas, Aliment, TypeJournee

class NutritionTestCase(TestCase):
    def setUp(self):
        self.user = User.objects.create_user(username='testuser', password='12345')
        
    def test_creation_journee(self):
        from datetime import date
        journee = Journee.objects.create(
            user=self.user,
            date=date.today(),
            type_journee=TypeJournee.PAUVRE
        )
        self.assertEqual(journee.type_journee, TypeJournee.PAUVRE)
