Closed athai closed 8 years ago
@matthewrsj - What should I redirect to in EnvironBuilder?
https://github.com/osuosl/formsender/blob/develop/tests.py#L69
@athai redirect shouldn't matter for tests as long as the field exists.
@athai I made one last comment on that test. After that I think it is good.
One thing to think about, though, is if this will be a required field. If it is required, you will need to add the send_to
field to all other tests that test validation methods (like this one: https://github.com/osuosl/formsender/blob/develop/tests.py#L91 or any other test that call on_form_page()
). If it is not required, you will need to set a default for when that field isn't present, which would require another test.
@Kennric thoughts on required vs optional with default?
@matthewrsj I'd say make it optional with a sensible default like support.
I agree. Then @athai you only have to make one more test that doesn't include that field and assert it's set to the default
The tests cover the cases:
send_to
is presentsend_to
is emptysend_to
is not present+1 from me
I think that's got it. +1
@matthewrsj @Kennric Is there anything I need to add to the formsender docs?
I was thinking that it may be useful to update http://formsender.readthedocs.org/en/latest/usage.html to display a dict in the email field since that better reflects what we're doing. Alongside that, adding 'send_to' to the optional fields section (http://formsender.readthedocs.org/en/latest/form_setup.html#optional-fields).
@athai yup that first link needs to be updated. Also update the EMAIL
description below that to show how to use it.
And yes the optional field section needs to be updated.
@athai just a few documentation things. The implementation looks great, the optional parameter really kept things simple.
Looks good. +1
+1 from me too. Thanks for cleaning up my test docstrings for me.
47.