Commit 6489aa7e authored by Daniel W Bond's avatar Daniel W Bond
Browse files

created test cases to verify get_semester(date) works properly

parent 0013627e
# standard library imports
from __future__ import absolute_import, print_function
from datetime import date
# core django imports
from django.test import TestCase
# imports from your apps
from welcome.views import get_semester
class GetSemesterTest(TestCase):
def test_summer_month(self):
created = date(month=7, day=4, year=2016) # Fourth of July
semester = get_semester(created)
self.assertEqual(semester, 'Summer')
def test_fall_month(self):
created = date(month=10, day=31, year=2016) # Halloween
semester = get_semester(created)
self.assertEqual(semester, 'Fall')
def test_spring_month(self):
created = date(month=1, day=1, year=2016) # New Years Day
semester = get_semester(created)
self.assertEqual(semester, 'Spring')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment