-
Notifications
You must be signed in to change notification settings - Fork 324
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
Validate date #109
Comments
Hi @jbouzekri, Cheers, |
Sorry for the late reply.
Regards |
Okay, so here's what I'm thinking, does this sound about right?
validators:
- 'between_dates': {query: 'document.1.createdDate', start: '01-01-2015', end: '07-07-2015', format: 'MM-DD-YYYY'} Long term, it's time to start considering adding an embedded expression language to the framework for more complex operations (or at least something that concisely supports function transformations on inputs). Potentially just escape out and allow raw python, although that has security implications. (Open to thoughts here!). |
This would be a good start to manipulate date. |
Do you mean in the between_dates validator? If not, please explain further. |
For example : by allowing a start:'utcnow', you could test that the date is in the future. |
@jbouzekri Hmm, okay -- as with any date handling, there are edge cases to be aware of but getting a basic implementation together is quite reasonable now that we've split it into reasonable pieces. Right now, we can tentatively schedule this feature for the 1.7.0 release aimed for late December, but it's likely it might slip into the next release after that; there is currently quite a bit of work left on large & critical features (Python 3 support, improved parsing and variable use, and Unicode handling fixes). If you'd like to help make it happen sooner, I'd certainly welcome a PR to add it to the PyRestTest core, and there should be a number of existing examples in the code that you can use as starting points! |
On second thought, make that January, just in case. |
This is not urgent. I have use cases related to dates but it can wait. As you have said you have nicely split the task in simpler ones. I cannot promise I will be able to work on a PR before January too but if I have the time, I will gladly work on it. Thanks for your feedback as always. |
Hi,
A lot of API manipulate date.
How can I use native functionnality of your tool to do it ? Or do I need to write my own extension ?
Thx
Regards
The text was updated successfully, but these errors were encountered: