Ticket #508 (closed patch: worksforme)
[Patch] Django test client
| Reported by: | madssj | Owned by: | madssj |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | Testing | Version: | |
| Keywords: | django, test, client, django test client | Cc: | |
| Fixed in revision: | Branch: | ||
| Author: |
Description
I've created a test client that can be used with django's test framework.
Attachments
Change History
comment:1 Changed 16 months ago by thijs
In order to integrate this into PyAMF we need some unit tests for this new code. You want to take a stab at that Mads?
comment:2 Changed 16 months ago by madssj
I may, what needs to be done, and where does it need to be done?
comment:3 Changed 16 months ago by thijs
- Keywords review added; client removed
- Status changed from new to assigned
I guess Nick would have a definite answer to that question but it seems to me that it would go in pyamf/trunk/pyamf/remoting/client/django/__init__.py or pyamf/trunk/pyamf/remoting/client/django.py. We're also planning to add a Twisted AMF client (#434) that would probably go in a similar place (pyamf/trunk/pyamf/remoting/client/twisted/__init__.py or pyamf/trunk/pyamf/remoting/client/twisted.py). What do you think?
comment:4 Changed 16 months ago by madssj
Because this is strictly a client that can be used for testing purposes, I think it would need to change name to TestClient or something like that, should it be located in pyamf.remoting.client.django.
Other than that, you didn't really answer anything about what kinds of unit tests this client would need :)
comment:5 Changed 16 months ago by nick
- Owner changed from nick to madssj
p.r.c.django.TestClient is a good name.
The unit tests that would be required would need to cover expected use-cases (something along the lines of the example in the docstring). i.e. pass in a django Client instance and you can still use the remoting client.
I would suggest setting up a mini django app (see the adapter test suite for a very hacky way we have set something up to run in our test suite) which would set a DjangoGateway at /gateway/ with a known service and check the response to calling it. More tests would need to be added to make sure the correct error response is being generated also.
Hope that gives you an indication of the kind of things we are looking for.
comment:7 Changed 5 months ago by nick
- Status changed from assigned to closed
- Resolution set to worksforme
Since tests aren't going to be included and the code for the client is attached here and in other blogs etc. I am closing this out. If unittests are developed in the future, this could be re-examined.

