adding food logging, phase 6

This commit is contained in:
Joren de Graaf
2026-10-03 21:29:16 +02:00
parent 8d1afab9e8
commit 90b21a39fc
3 changed files with 21 additions and 1 deletions
+9
View File
@@ -118,3 +118,12 @@ class RepeatLoggingTests(TestCase):
self.assertContains(response, 'id="food-workspace"')
self.assertNotContains(response, '<!doctype html>')
self.assertNotIn('HX-Push-Url', response)
def test_add_and_edit_use_settings_switches(self):
add = self.client.get(reverse('food:add'), {'product': self.product.pk})
self.assertContains(add, 'settings-switch__track', count=2)
entry = FoodLogEntry.objects.create(user=self.user, date=date(2026, 10, 3),
meal=MealType.BREAKFAST, product=self.product, product_name_snapshot='Greek yoghurt',
amount=100, unit=Unit.GRAM)
edit = self.client.get(reverse('food:edit', args=[entry.pk]))
self.assertContains(edit, 'settings-switch__track', count=2)