src/cm/tests/test_activity.py
author Simon Descarpentries <sid@sopinspace.com>
Wed, 30 Oct 2013 18:08:42 +0100
changeset 556 69503659fe8f
parent 303 31eb61fe6cf4
permissions -rw-r--r--
[c_selection.js] If safari_mobile, get current selection from a previously created global variable [c_sync.js] ref where the safari_mobile global is used [c_text_view_comments.js] if safari_mobile update selection also on selectionChange event [text_view_comments.html] if safari_mobile store a clone of the current selection on each selectionChange set layout width to 99% to improve display factorize safari mobile detection code

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])