Skip to content

Instantly share code, notes, and snippets.

@vbabiy
Created July 24, 2013 22:48
Show Gist options
  • Save vbabiy/6075345 to your computer and use it in GitHub Desktop.
Save vbabiy/6075345 to your computer and use it in GitHub Desktop.
Working extract method
class TestHome(TestCase):
def test_home_template_used(self):
res = self.get_name()
self.assertTemplateUsed(res, 'home.html')
def get_name(self):
res = self.client.get('/')
return res
def test_home_template_contains_hello_world(self):
res = self.get_name()
self.assertContains(res, 'Hello World')
class TestHome(TestCase):
def test_home_template_used(self):
res = self.client.get('/')
self.assertTemplateUsed(res, 'home.html')
def test_home_template_contains_hello_world(self):
res = self.client.get('/')
self.assertContains(res, 'Hello World')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment