[Answer]-How to test Django Form ChoiceField

1πŸ‘

βœ…

I could bring the test to fail in exactly the same way, if I post an invalid choice. Posting Bronze passes the test, but I have the choices hardcoded in the form class and don’t fetch them dynamically from the database.

Makes me think if the plans exist in the database of the unit test (or in a mocked queryset) so that they are fetched correctly from Plan.objects.get_choices()?

πŸ‘€sthzg

Leave a comment