def test_get_score_sheet_if_present_in_db_but_outdated(self): old_date = "15/11/2016" json_obj = json.loads(self.score_encoding.document) json_obj['publication_date'] = old_date self.score_encoding.document = json.dumps(json_obj) self.score_encoding.save() document = score_encoding.get_score_sheet(GLOBAL_ID) self.assertIsNone(document)
def test_get_score_sheet_if_present_in_db(self): document = score_encoding.get_score_sheet(GLOBAL_ID) self.assertJSONEqual(self.score_encoding.document, document)
def test_get_score_sheet_if_not_present_in_db(self): self.score_encoding.delete() document = score_encoding.get_score_sheet(GLOBAL_ID) self.assertIsNone(document)
def test_get_score_sheet_invalid_json(self): global_id = "007896" test_score_encoding.create_invalid_score_encoding(global_id=global_id) document = score_encoding.get_score_sheet(global_id) self.assertIsNone(document)