The examples in the documentation don't seem to set form_list, but all the versions in the tests here do.
TLDR: Either I'm doing something wrong around form_list (in which case the docs could be improved) - or form_list itself could be easier to use.
In detail -
I'm trying to write unit tests for a form wizard [1], get_form_list and anything that call it fail - because our form doesn't actually set this, it's only setup in as_view.
This means form_list is still set to None and things fail.
Looking at the code, I'm not sure if I should change the code so we always set form_list as I can't find info on it in the docs.
Without knowing too much about it - it seems like it would be more straightforward if the advice was to always set this, or if it was set elsewhere than as_view, since it seems pretty hard to write tests for form wizards that don't set form_list as a class attribute.
The examples in the documentation don't seem to set form_list, but all the versions in the tests here do.
TLDR: Either I'm doing something wrong around form_list (in which case the docs could be improved) - or form_list itself could be easier to use.
In detail - I'm trying to write unit tests for a form wizard [1],
get_form_list
and anything that call it fail - because our form doesn't actually set this, it's only setup inas_view
.This means form_list is still set to None and things fail.
Looking at the code, I'm not sure if I should change the code so we always set form_list as I can't find info on it in the docs.
Without knowing too much about it - it seems like it would be more straightforward if the advice was to always set this, or if it was set elsewhere than as_view, since it seems pretty hard to write tests for form wizards that don't set form_list as a class attribute.
[1] https://github.com/uktrade/tamato/blob/master/measures/views.py#L72 Our form wizard implementation - should I change this so that form_list is always set, after STEPS to make it easier to test?