Skip to content

Instantly share code, notes, and snippets.

@mineta
Last active August 29, 2015 13:56
Show Gist options
  • Save mineta/9306188 to your computer and use it in GitHub Desktop.
Save mineta/9306188 to your computer and use it in GitHub Desktop.
from django.test import TestCase
class TestExample(TestCase):
"""
Here you can define multiple tests, but all must begin
with test_
"""
def setUp(self):
"""
Optional. Define here your initial setup for your tests
"""
self.a = "my test"
def tearDown(self):
"""
Optional. This will be executed after running your tests
"""
del self.a
def test_example(self):
self.assertEqual("my test", self.a)
def test_example2(self):
b = 2
self.assertNotEqual(b, "two")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment