Skip to content

Commit

Permalink
Client API test for passing source name to the backend on patients.get
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Lavin committed Feb 14, 2013
1 parent 96d33c9 commit 3d71915
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion healthcare/tests/test_api.py
Expand Up @@ -150,4 +150,13 @@ def test_unlink_patient(self):
"Unlink a patient with an another ID with the API client."
with patch('healthcare.backends.dummy.DummyStorage.unlink_patient') as unlink:
self.client.patients.unlink(123, 'abc', 'FOO')
self.assertTrue(unlink.called, "Backend unlink_patient should be called.")
self.assertTrue(unlink.called, "Backend unlink_patient should be called.")

def test_get_patient_for_source(self):
"Get a patient by source id/source name."
with patch('healthcare.backends.dummy.DummyStorage.get_patient') as get:
self.client.patients.get(123, source='ABC')
self.assertTrue(get.called, "Backend get_patient should be called.")
args, kwargs = get.call_args
self.assertEqual(123, args[0])
self.assertEqual('ABC', kwargs['source'])

0 comments on commit 3d71915

Please sign in to comment.