gdbelvin/mail-safe-test — pull request #2 by hpshelton (2014-07-27 02:32:03+00:00)
Title: Fix Sydney's implementation of Contact and add tests

I pulled Sydney's initial ContactModel and /contact/ implementation down and think I finally figured out the parent/ancestor key_name/key_id conflicts such that this now works as intended where a successful query requires the owner's id and the contact id from the slug. Since there are now lots of tests, if I didn't do it correctly or your think it's still messy, feel free to poke around and clean up the queries more, but note that if you change the constructor call in POST, you have to also update the test setup methods to keep key structures similar.

Limitations:
* You have to provide the contact ID in the original POST slug. Not sure if we want these randomly generated by the frontend or the backend.
* The return value doesn't include the NDBUrl because I was seeing Flask BuildExceptions when trying to include it.
* I didn't touch Doc yet, so everything there is unlikely to be working.
* HTTP status codes are all out of whack for all the Contact endpoints and should be reconciled later. Note that this will break the tests.