def test_modified_by_title(self): request = testing.DummyRequest() context = testing.DummyModel() root = karltesting.DummyRoot() root['foo'] = context context.modified_by = 'dummy1' adapter = self._makeOne(context, request) self.assertEqual(adapter.modified_by_title, "Dummy One")
def test_modified_by_url(self): request = testing.DummyRequest() context = testing.DummyModel() root = karltesting.DummyRoot() root['foo'] = context context.modified_by = 'dummy1' adapter = self._makeOne(context, request) self.assertEqual(adapter.modified_by_url, "http://example.com/profiles/dummy1/")
def test_lockdata(self): from datetime import datetime from karl.utilities import lock past = datetime(1985, 1, 1, 0, 0, 1) now = datetime(1985, 1, 1, 0, 0, 10) context = karltesting.DummyModel() request = testing.DummyRequest() site = karltesting.DummyRoot() site['bar'] = context lock.lock(context, 'foo', past) lockdata = lock.lock_info_for_view(context, request, now) self.failUnless(lockdata['is_locked'])