src/cm/tests/test_activity.py
author ymh <ymh.work@gmail.com>
Fri, 14 Mar 2014 10:03:37 +0100
changeset 610 dc75c8d65289
parent 303 31eb61fe6cf4
permissions -rw-r--r--
add a way to specify the custom.yaml file path with the SYSCONFIG env variable

from django.test import TestCase
from django.test.client import Client
from django.core import management
from datetime import datetime
from cm.activity import *
from cm.models import *
from cm.security import *

class ActivityTest(TestCase):
    fixtures = ['roles_generic','test_content']
    
    def test_process_activities(self):
        text = Text.objects.get(id=1)
        activity = get_activity(text, user='all', reference_date=datetime(2009,02,01))
        self.assertEqual(activity, [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1])