def test_compare_different(self): obj1 = Field(name="Price", type=FieldType.Integer, value=100, displayName="Цена") obj2 = Field(name="Price", type=FieldType.Integer, value=50, displayName="Цена") obj1.compare(obj2, 100, 200) self.assertEqual(obj1.changes, dict([[100, 50], [200, 100]]))
def test_compare_same(self): obj1 = Field(name="Price", type=FieldType.Integer, value=100, displayName="Цена") obj2 = Field(name="Price", type=FieldType.Integer, value=100, displayName="Цена") obj1.compare(obj2, 100, 200) self.assertEqual(obj1.changes, dict())