Project

General

Profile

« Previous | Next » 

Revision 8b82d1fa

Added by Mikaël Ates about 13 years ago

dossiers: add FileRecord creation and state switching tests.

View differences:

calebasse/dossiers/tests.py
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
# -*- coding: utf-8 -*-
from django.test import TestCase
from django.contrib.auth.models import User
Replace this with more appropriate tests for your application.
"""
from models import create_patient
from calebasse.ressources.models import Service
from states import *
from django.test import TestCase
class PatientRecordTest(TestCase):
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
def test_states(self):
creator = User.objects.create(username='John')
for service_name in ('CMPP', 'CAMSP', 'SESSAD'):
service = Service.objects.create(name=service_name)
patient = create_patient('John', 'Doe', service, creator)
for state in STATES[service.name].keys()[1:]:
patient.set_state(state, creator)

Also available in: Unified diff