Skip to content

Conversation

@juanelias-eb
Copy link
Collaborator

@juanelias-eb juanelias-eb commented Oct 9, 2019

In order to allow the user to check when did she mark conditions as done, the InstallmentCondition model had to be refactored.

This involved changing the "done" field from a BooleanField to a DateTimeField, which is initially null and stores a timestamp when the user marks it as done.

Also freezegun was installed to patch datetime.now when testing this.

Copy link

@francob-eb francob-eb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

litle comment but lgtm

}
contract = Contract(**contract_data)
contract.save()
contract = Contract.objects.create(**contract_data)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you consider using factory_boy? It will simplify all your tests, you can create django models objects easily. Usage:
Creating factories: https://github.com/evbeda/imahunga/blob/master/bundesliga_app/factories.py
Using factories in tests: https://github.com/evbeda/imahunga/blob/master/bundesliga_app/tests.py#L256-L271

@walterbucolo-eb walterbucolo-eb merged commit 04a5ff6 into master Oct 9, 2019
@juanelias-eb juanelias-eb deleted the conditions_check branch November 4, 2019 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants