-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Field inference strategies for django.contrib modules
#3417
Comments
|
I would be delighted to add support for anything that ships as part of the If you're interested, I'd love to collaborate on a PR to add support for these fields 😃 |
|
Thanks for the feedback @Zac-HD I created #3419 to address the A slightly unrelated question, the django @given(from_form(UserCreationForm, password2="same as password1"))
def test_user_creation_form():
pass |
Inasmuch as polygons are more complicated than strings, yep; but that's going from easy to medium rather than actually hard. Follow-up PR?
The From there, it looks like we need some automatic way for |
|
I was just going through some notes and thought that pytest-dev/pytest-django#912 might also be of interest to you as Django dev 🙂 |
|
Closing this because we've solved the motivating use-case and I can't think of a good general heuristic for recognizing fields that need the same value. |
I noticed that _global_field_lookup does not define strategies for some form fields, s.a UsernameField and ReadOnlyPasswordHashField.
This makes the code below raise a ResolutionFailed exception:
It is quite useful in Django to use, or inherit from
UserCreationFormwhen creating signup forms, and providing a default strategies for these fields would make testing easier without requiring toregister_field_strategyfor those fields.I also noticed that there are no strategies for form fields defined
django.contrib.gismodule, so I assume that would be out of scope for this integration?The text was updated successfully, but these errors were encountered: