Skip to content

Conversation

@alee046
Copy link
Collaborator

@alee046 alee046 commented Aug 31, 2016

No description provided.


self.menu = Menu.objects.create(chef=self.chef, title='foxy food', delivery=True )
self.item = Item.objects.create(menu=self.menu, title="kibbles", size="the whole bowl",
price=13.33, description="food for foxy")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be one more line break here between setup and the first test!

self.assertFalse(Menu.objects.filter(chef=self.chef).exists())
menu = Menu.objects.create(chef=self.chef, title='foxy food', delivery=True )
self.assertTrue(Menu.objects.filter(chef=self.chef).exists())
self.assertFalse(Menu.objects.filter(title='foxys favorites').exists())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to really test this part. I would just start on line 28 with the "assertTrue" that the menu exists. That way you can use the menu from setup (self.menu) (you'll have to change it in all the other places you reference "menu" as well so don't forget that). This test is more about testing the link between menu and item then it is about testing the menu creation. Make sense? (maybe we should rename this test to test_menu_item_link?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants