Skip to content

Instantly share code, notes, and snippets.

@alxpck
Created July 30, 2015 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alxpck/44a3c3ce700bfacd4d0e to your computer and use it in GitHub Desktop.
Save alxpck/44a3c3ce700bfacd4d0e to your computer and use it in GitHub Desktop.
from django.test import TestCase
from django.utils import timezone
from .models import Course
# Create your tests here.
class CourseModelTests(TestCase):
def test_course_creation(self):
course = Course.objects.create(
title="Python Regular Expressions",
description="Learn to write regular expressions in Python"
)
now = timezone.now()
self.assertLess(course.created_at, now)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment