Created
August 10, 2018 01:01
-
-
Save moacirmoda/49f195a5c2de7e98a209e33fdea2cd96 to your computer and use it in GitHub Desktop.
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 myapp.models import Person | |
class PersonTestCase(TestCase): | |
def test_should_return_attributes(self): | |
self.assertTrue(hasattr(Person, 'first_name')) | |
self.assertTrue(hasattr(Person, 'last_name')) | |
self.assertTrue(hasattr(Person, 'age')) | |
def test_should_create_item(self): | |
person = Person.objects.create(first_name='Moacir', last_name='Moda', age=27) | |
self.assertIsNotNone(person) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment