Skip to content

Commit

Permalink
Merge branch '427-initial-patient-load-update-fix' into v0.3.5.rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
fredkingham committed Jul 19, 2018
2 parents b2a8a68 + f4b1a02 commit 8d2d17d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion intrahospital_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Meta:


class InitialPatientLoad(PatientLoad, PatientSubrecord):
""" this model is the initial load of a patient
""" This model is the initial load of a patient
future loads are done by the cron batch load
"""

Expand All @@ -96,6 +96,11 @@ def __unicode__(self):
self.started
)

def update_from_dict(self, data, *args, **kwargs):
""" For the purposes of the front end this model is read only.
"""
pass


class BatchPatientLoad(PatientLoad):
""" This is the batch load of all reconciled patients
Expand Down
4 changes: 4 additions & 0 deletions intrahospital_api/test/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def test_unicode_stopped(self):
unicode(self.ipl)
self.assertTrue(m.called)

def test_update_from_dict(self):
self.ipl.update_from_dict(dict(state=self.ipl.SUCCESS))
self.assertEqual(self.ipl.state, self.ipl.RUNNING)


class BatchPatientLoadTestCase(OpalTestCase):
def setUp(self):
Expand Down

0 comments on commit 8d2d17d

Please sign in to comment.