Hi thanks for you very useful post, I didn't get how can this snippet works, if FilledTransactionFactory.build() does not create database obj, t.id will be None. I missed something?
@pytest.mark.unit def test_serialized_data(self): t = FilledTransactionFactory.build() valid_serialized_data = { 'id': t.id.hashid,
It does build an object, it just doesn't hit the database to store it. It's like instantiating a common python object
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi thanks for you very useful post, I didn't get how can this snippet works, if FilledTransactionFactory.build() does not create database obj, t.id will be None. I missed something?
It does build an object, it just doesn't hit the database to store it. It's like instantiating a common python object