7.6 Green? Refactor
parent
2e3ddeb036
commit
541e85a01f
|
@ -9,10 +9,6 @@ from lists.models import Item
|
||||||
|
|
||||||
class HomePageTest(TestCase):
|
class HomePageTest(TestCase):
|
||||||
|
|
||||||
def test_root_url_resolves_to_home_page_view(self):
|
|
||||||
found = resolve('/')
|
|
||||||
self.assertEqual(found.func, home_page)
|
|
||||||
|
|
||||||
def test_uses_home_template(self):
|
def test_uses_home_template(self):
|
||||||
response = self.client.get('/')
|
response = self.client.get('/')
|
||||||
self.assertTemplateUsed(response, 'home.html')
|
self.assertTemplateUsed(response, 'home.html')
|
||||||
|
@ -34,15 +30,6 @@ class HomePageTest(TestCase):
|
||||||
self.client.get('/')
|
self.client.get('/')
|
||||||
self.assertEqual(Item.objects.count(), 0)
|
self.assertEqual(Item.objects.count(), 0)
|
||||||
|
|
||||||
def test_displays_all_list_items(self):
|
|
||||||
Item.objects.create(text="itemey 1")
|
|
||||||
Item.objects.create(text="itemey 2")
|
|
||||||
|
|
||||||
response = self.client.get('/')
|
|
||||||
|
|
||||||
self.assertIn('itemey 1', response.content.decode())
|
|
||||||
self.assertIn('itemey 2', response.content.decode())
|
|
||||||
|
|
||||||
class ListViewTest(TestCase):
|
class ListViewTest(TestCase):
|
||||||
|
|
||||||
def test_displays_all_items(self):
|
def test_displays_all_items(self):
|
||||||
|
|
Loading…
Reference in New Issue