def setUp(self): self.collection = base.Collection() self.tracker = base.ChangeTracker(self.collection) self.object = base.CompositeObject()
def testChangeTrackerIgnoresChangesToObjectsNotInCollection(self): self.collection.append(self.object) self.tracker.reset() secondObject = base.CompositeObject() secondObject.setSubject('New subject') self.failIf(self.tracker.modified())
def testLookupIdWhenObjectIsInCollection(self): domainObject = base.CompositeObject() self.collection.append(domainObject) self.assertEqual(domainObject, self.collection.getObjectById(domainObject.id()))
def testSetExpansionStatesViaConstructor(self): compositeObject = base.CompositeObject( expandedContexts=['context1', 'context2']) self.assertEqual(['context1', 'context2'], sorted(compositeObject.expandedContexts()))
def testSetExpansionStateViaConstructor(self): compositeObject = base.CompositeObject(expandedContexts=['None']) self.failUnless(compositeObject.isExpanded())
def addChild(self, **kwargs): self.child = base.CompositeObject(**kwargs) self.compositeObject.addChild(self.child) self.child.setParent(self.compositeObject)
def setUp(self): self.compositeObject = base.CompositeObject() self.child = None self.eventsReceived = []