mingchen/django-cas-ng — pull request #8 by pipermerriam (2014-11-06 21:02:49+00:00)
Title: Refactor cas3 verification and add tests

### What is the problem / feature ?

- The `django_cas_ng.backends._verify_cas3` function had no tests.
- The structure of the function was difficult to test, as it made a http request during it's execution.

### How did it get fixed / implemented ?

- first verified it worked as-is using `django-mama-cas` as the CAS server.
- grabbed example successful responses for cas3 verification from the CAS server.
- split the function into two pieces, one that does the http request, and a second that holds the verification business logic.
- Added tests around the business logic against the captured CAS server responses.

### How can someone test / see it ?

Take a look at the code, or see that your cas3 validation still works.

*Here is a cute animal picture for your troubles...*

![bear-cub-playing-with-teddy-bear-big 1](https://cloud.githubusercontent.com/assets/824194/4943848/428827b0-65f8-11e4-9916-c27006783427.jpg)