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
Fixed #23606 -- Implement the RequestFactory trace() method #3353
Conversation
self.request_factory = RequestFactory() | ||
|
||
def tearDown(self): | ||
del(self.request_factory) |
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.
Should be del self.request_factory
.
Commit f863574 changes the |
@@ -22,7 +22,7 @@ restricted subset of the test client API: | |||
* It only has access to the HTTP methods :meth:`~Client.get()`, | |||
:meth:`~Client.post()`, :meth:`~Client.put()`, | |||
:meth:`~Client.delete()`, :meth:`~Client.head()` and | |||
:meth:`~Client.options()`. | |||
:meth:`~Client.options()`, :meth:`~Client.trace()`. |
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.
Need to move the "and" from line 24.
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.
Oops.. Fixed in 0c5a657
You can go ahead and squash your commits after those updates, thanks. |
I've submitted the changes, as suggested. Thanks for the feedback. |
""" | ||
Send a TRACE request to the server. | ||
|
||
:param path: the Request-URI |
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.
same comment about comment style applies here
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.
Fixed.
Could you squash the commits please? |
The RequestFactory class did not implement a trace() method, and therefore raised an AttributeError when used to create TRACE requests. This change implements a factory method that returns a very basic TRACE request object, which should be suitable for most test cases. It also reworks the original TestClientTests suite so that the following conditions are checked: - The test factory can create requests for all the HTTP/1.1 methods; - The GET request test is tested separately; - The TRACE request is tested with a test view that simulates the echo response, according to rfc2616.
I have now squashed all the my commits. |
buildbot, test this please. |
merged in 2863439, thanks! |
The RequestFactory class did not implement a trace() method, and
therefore raised an AttributeError when used to create TRACE requests.
This change implements a factory method that returns a very basic TRACE
request object, which should be suitable for most test cases.
It also reworks the original TestClientTests suite so that the following
conditions are checked:
This fixes https://code.djangoproject.com/ticket/23606