You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, writing tests for our API views is a big pain in the ass. They're long, and mostly boilerplate.
Could we take advantage of Python's dynamism and write an AutoTestCase? Something that, given some classes (API URL, Serializer, Model, whatever), could iterate over all the fields to figure out what they could be, and then send various requests and verify the responses?
This would be a MASSIVE win for developer efficiency and code quality: writing tests would be so much easier, so we'd write more tests and get better coverage.
We'd also have to write an AutoTestCaseTestCase to make sure that AutoTestCase is working properly (who watches the watchmen, etc.) 😃
@nathanielparke, @tdowds: sounds like a task for a relatively experienced engineer. Any interest?
The text was updated successfully, but these errors were encountered:
This introduces the first auto test case for the retrieve API. The implementor provides the actual object under test, and a tuple of (username, password, expected_error). The expected error is what that user should get from the API. If it's `None`, that means the request should be accepted.
If the request is accepted, we then use the serializer to figure out what fields the object is going to have. Most of the time, it's pretty straightforward, but sometimes (like for decimal fields, or relational fields), we have to do some transformations.
This will (hopefully) make it much easier to add test cases to the API. Or, at the very least, it'll allow us to clean up our fugly existing test cases.
Task: #475
This introduces the first auto test case for the retrieve API. The implementor provides the actual object under test, and a tuple of (username, password, expected_error). The expected error is what that user should get from the API. If it's `None`, that means the request should be accepted.
If the request is accepted, we then use the serializer to figure out what fields the object is going to have. Most of the time, it's pretty straightforward, but sometimes (like for decimal fields, or relational fields), we have to do some transformations.
This will (hopefully) make it much easier to add test cases to the API. Or, at the very least, it'll allow us to clean up our fugly existing test cases.
Task: #475
Currently, writing tests for our API views is a big pain in the ass. They're long, and mostly boilerplate.
Could we take advantage of Python's dynamism and write an AutoTestCase? Something that, given some classes (API URL, Serializer, Model, whatever), could iterate over all the fields to figure out what they could be, and then send various requests and verify the responses?
This would be a MASSIVE win for developer efficiency and code quality: writing tests would be so much easier, so we'd write more tests and get better coverage.
We'd also have to write an AutoTestCaseTestCase to make sure that AutoTestCase is working properly (who watches the watchmen, etc.) 😃
@nathanielparke, @tdowds: sounds like a task for a relatively experienced engineer. Any interest?
The text was updated successfully, but these errors were encountered: