-
Notifications
You must be signed in to change notification settings - Fork 83
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
Make 'nailgun.entity_fields.URLField.gen_value' method always generates unique value #190
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
|
||
""" | ||
from fauxfactory import ( | ||
gen_alpha, | ||
gen_boolean, | ||
gen_choice, | ||
gen_date, | ||
|
@@ -265,4 +266,4 @@ class URLField(StringField): | |
|
||
def gen_value(self): | ||
"""Return a value suitable for a :class:`URLField`.""" | ||
return gen_url() | ||
return gen_url(subdomain=gen_alpha()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 9gag and 4chan fans might get upset about this solution..how about this? return gen_url(subdomain=gen_alphanumeric()) also, how about including a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not restrict or introduce any limitation to possible URL, so if you like to use particular URL in your specific test case - just do it, but for generic scenario (for create_missing() method) I prefer to use most basic generator method, so it will be applicable for most possible situations There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rplevka You're right. It'd be good to generate more "interesting" data. I didn't both pushing for the change, though, because this PR really just works around issues in the underlying fauxfactory library. An even better solution is to make the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What are they? Is there an issue filed to track them? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @omaciel There's two issues:
omaciel/fauxfactory#26 is describes how There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @omaciel from my observation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this. I must've copied and pasted. Blech!