zen4ever / django-authorizenet

Django and Authorize.NET payment gateway integration
MIT License
87 stars 36 forks source link

Add tests #24

Closed treyhunner closed 11 years ago

treyhunner commented 11 years ago

I think all code should have tests.

The tests shouldn't depend on the Authorize.NET servers so [mock][] should probably be used to mock calls to request.post and other network calls as needed.

I may turn this into a pull request if I decide to start writing some tests.

Goals of this PR:

zen4ever commented 11 years ago

Yes, either mock or httmock (from #22), whatever makes more sense.

treyhunner commented 11 years ago

I converted this to a pull request and added a checklist to the description.

Which Python/Django versions should be tested? The current tox file I've added tests Python 2.6 and 2.7 and Django 1.4, 1.5, and trunk.

zen4ever commented 11 years ago

Yes. Supporting those versions seems reasonable to me. We need Python 2.6 since it goes by default on current version of Amazon Linux. And hopefully supporting two versions of Django would be enough.

treyhunner commented 11 years ago

@zen4ever can you enable the repository on Travis CI? Travis adds a post-receive hook on Github which requires admin access to add.

zen4ever commented 11 years ago

@treyhunner should be enabled now

coveralls commented 11 years ago

Coverage Status

Changes Unknown when pulling 9f11aa6e75d2a30aff3cd50f7899e4407afbf8bf on tests into \ on master**.

treyhunner commented 11 years ago

I went with httmock because it's simple.

I added a couple example tests including a test for one of the add_profile success cases.

I added Travis and Coveralls badges to the README file. I can remove that commit if you don't like showing those in the README.

I disabled the coveralls comments on pull requests (they happen on every push which can get annoying).

I think this is ready to be merged now. There are very few tests currently, but some tests are better than none.

zen4ever commented 11 years ago

Looks good. Feel free to merge it. I will try to add some more tests later.