Add institution detail view with stats

This commit is contained in:
Claude Paroz 2013-04-08 14:19:23 +02:00
parent f6ff281d4b
commit 4b6a8d50c3
8 changed files with 147 additions and 3 deletions

View file

@ -1,8 +1,11 @@
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from .models import Student, Availability, Referent
from .models import Period, Student, Availability, Referent
class StagesTest(TestCase):
fixtures = ['test_fixture.json']
@ -29,4 +32,12 @@ class StagesTest(TestCase):
self.assertEqual(response.content, b'OK')
avail = Availability.objects.get(pk=2)
self.assertEqual(avail.training.student, student)
def test_period_schoolyear(self):
per = Period.objects.get(pk=1)
self.assertEqual(per.school_year, "2012 — 2013")
def test_period_weeks(self):
per = Period.objects.get(pk=1)
self.assertEqual(per.weeks, 1)