예제 #1
0
    def test_mark_results_ready(self):
        db._revert_ready(["000023299"])
        obs = db.get_ag_barcode_details(["000001072", "000023299"])
        self.assertEqual(obs["000023299"]["results_ready"], None)
        self.assertEqual(obs["000001072"]["results_ready"], "Y")

        obs = db.mark_results_ready(["000001072", "000023299"], debug=True)
        self.assertEqual(obs["new_bcs"], ("000023299",))
        self.assertEqual(obs["mail"]["mimetext"]["To"], "*****@*****.**")
        self.assertEqual(obs["mail"]["mimetext"]["From"], "")
        self.assertEqual(obs["mail"]["mimetext"]["Subject"], "Your American/British Gut results are ready")
        self.assertEqual(obs["mail"]["recipients"], ["*****@*****.**", "REMOVED"])

        obs = db.get_ag_barcode_details(["000001072", "000023299"])
        self.assertEqual(obs["000023299"]["results_ready"], "Y")
        self.assertEqual(obs["000001072"]["results_ready"], "Y")
예제 #2
0
    def test_mark_results_ready(self):
        db._revert_ready(['000023299'])
        obs = db.get_ag_barcode_details(['000001072', '000023299'])
        self.assertEqual(obs['000023299']['results_ready'], None)
        self.assertEqual(obs['000001072']['results_ready'], 'Y')

        obs = db.mark_results_ready(['000001072', '000023299'], debug=True)
        self.assertEqual(obs['new_bcs'], ('000023299', ))
        self.assertEqual(obs['mail']['mimetext']['To'],
                         '*****@*****.**')
        self.assertEqual(obs['mail']['mimetext']['From'], '')
        self.assertEqual(obs['mail']['mimetext']['Subject'],
                         'Your American/British Gut results are ready')
        # don't compare name, since it is scrubbed to random chars
        self.assertEqual(obs['mail']['recipients'][0], '*****@*****.**')

        obs = db.get_ag_barcode_details(['000001072', '000023299'])
        self.assertEqual(obs['000023299']['results_ready'], 'Y')
        self.assertEqual(obs['000001072']['results_ready'], 'Y')
예제 #3
0
    def test_mark_results_ready(self):
        db._revert_ready(['000023299'])
        obs = db.get_ag_barcode_details(['000001072', '000023299'])
        self.assertEqual(obs['000023299']['results_ready'], None)
        self.assertEqual(obs['000001072']['results_ready'], 'Y')

        obs = db.mark_results_ready(['000001072', '000023299'], debug=True)
        self.assertEqual(obs['new_bcs'], ('000023299', ))
        self.assertEqual(obs['mail']['mimetext']['To'],
                         '*****@*****.**')
        self.assertEqual(obs['mail']['mimetext']['From'], '')
        self.assertEqual(obs['mail']['mimetext']['Subject'],
                         'Your American/British Gut results are ready')
        self.assertEqual(obs['mail']['recipients'],
                         ['*****@*****.**', 'REMOVED'])

        obs = db.get_ag_barcode_details(['000001072', '000023299'])
        self.assertEqual(obs['000023299']['results_ready'], 'Y')
        self.assertEqual(obs['000001072']['results_ready'], 'Y')
예제 #4
0
 def tearDown(self):
     db._clear_table('external_survey_answers', 'ag')
     db._revert_ready(['000023299'])
예제 #5
0
 def tearDown(self):
     db._clear_table("external_survey_answers", "ag")
     db._revert_ready(["000023299"])
예제 #6
0
 def tearDown(self):
     db._clear_table('external_survey_answers', 'ag')
     db._revert_ready(['000023299'])