Created
August 26, 2015 19:32
-
-
Save walterrenner/90852eec845019da0feb to your computer and use it in GitHub Desktop.
Minimal django TestCase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test import TestCase | |
from .models import Thing | |
# Create your tests here. | |
class TestModels(TestCase): | |
def test_saving_a_model(self): | |
thing = Thing.objects.create() | |
thing.save() | |
self.assertEqual(Thing.objects.all().count(), 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment