def test_create_item(self): testItem = Item() testItem.source = 'Testing' testItem.instance_id = '1' self.assertEqual(str(testItem), '<Item(source=Testing, instance=None)>')
def test_item_update(self): testData = {'source': 'newSource'} testItem = Item() testItem.source = 'oldSource' with patch.multiple(Item, createTmpRelations=DEFAULT, updateIdentifiers=DEFAULT, updateAgents=DEFAULT, updateMeasurements=DEFAULT, updateLinks=DEFAULT, updateDates=DEFAULT, updateRights=DEFAULT, removeTmpRelations=DEFAULT) as item_mocks: testItem.update('session', testData) self.assertEqual(testItem.source, 'newSource')