Esempio n. 1
0
 def test_deconstruction(self, entity, data):
     factory = Factory(Bike)
     result = factory.deconstruct(entity)
     assert result == data
     assert result.id == entity.id
Esempio n. 2
0
 def test_deconstruction_with_fields(self, entity, dto):
     factory = Factory(Bike, fields=('wheel_type', ))
     result = factory.deconstruct(entity)
     assert result == {'wheel_type': 'road'}
     assert result.id == entity.id
 def test_deconstruction_with_fields(self, entity, dto):
     factory = Factory(Bike, fields=("wheel_type", ))
     result = factory.deconstruct(entity)
     assert result == {"wheel_type": "road"}
     assert result.id == entity.id