예제 #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 test_get_ag_barcode_details(self):
     obs = db.get_ag_barcode_details(['000018046'])
     ag_login_id = '0060a301-e5bf-6a4e-e050-8a800c5d49b7'
     exp = {
         '000018046': {
             'ag_kit_barcode_id': '0060a301-e5c1-6a4e-e050-8a800c5d49b7',
             'verification_email_sent': 'n',
             'pass_reset_code': None,
             'vioscreen_status': 3,
             'sample_barcode_file': '000018046.jpg',
             'environment_sampled': None,
             'supplied_kit_id': db.ut_get_supplied_kit_id(ag_login_id),
             'withdrawn': None,
             'kit_verified': 'y',
             # 'city': 'REMOVED',
             'ag_kit_id': '0060a301-e5c0-6a4e-e050-8a800c5d49b7',
             # 'zip': 'REMOVED',
             'ag_login_id': ag_login_id,
             # 'state': 'REMOVED',
             'results_ready': 'Y',
             'moldy': 'N',
             # The key 'registered_on' is a time stamp when the database is
             # created. It is unique per deployment.
             # 'registered_on': datetime.datetime(2016, 8, 17, 10, 47, 2,
             #                                   713292),
             # 'kit_password': ('$2a$10$2.6Y9HmBqUFmSvKCjWmBte70WF.zd3h4Vqb'
             #                  'hLMQK1xP67Aj3rei86'),
             # 'deposited': False,
             'sample_date': datetime.date(2014, 8, 13),
             # 'email': 'REMOVED',
             'print_results': False,
             'open_humans_token': None,
             # 'elevation': 0.0,
             'refunded': None,
             # 'other_text': 'REMOVED',
             'barcode': '000018046',
             'swabs_per_kit': 1L,
             # 'kit_verification_code': '60260',
             # 'latitude': 0.0,
             'cannot_geocode': None,
             # 'address': 'REMOVED',
             'date_of_last_email': datetime.date(2014, 8, 15),
             'site_sampled': 'Stool',
             # 'name': 'REMOVED',
             'sample_time': datetime.time(11, 15),
             # 'notes': 'REMOVED',
             'overloaded': 'N',
             # 'longitude': 0.0,
             'pass_reset_time': None,
             # 'country': 'REMOVED',
             'survey_id': '084532330aca5885',
             'other': 'N',
             'sample_barcode_file_md5': None
         }
     }
예제 #5
0
 def test_get_ag_barcode_details(self):
     obs = db.get_ag_barcode_details(["000018046"])
     exp = {
         "000018046": {
             "ag_kit_barcode_id": "0060a301-e5c1-6a4e-e050-8a800c5d49b7",
             "verification_email_sent": "n",
             "pass_reset_code": None,
             "vioscreen_status": 3,
             "sample_barcode_file": "000018046.jpg",
             "environment_sampled": None,
             "supplied_kit_id": "tst_nVEyP",
             "withdrawn": None,
             "kit_verified": "y",
             "city": "REMOVED",
             "ag_kit_id": "0060a301-e5c0-6a4e-e050-8a800c5d49b7",
             "zip": "REMOVED",
             "ag_login_id": "0060a301-e5bf-6a4e-e050-8a800c5d49b7",
             "state": "REMOVED",
             "results_ready": "Y",
             "moldy": "N",
             # The key 'registered_on' is a time stamp when the database is
             # created. It is unique per deployment.
             # 'registered_on': datetime.datetime(2016, 8, 17, 10, 47, 2,
             #                                   713292),
             "participant_name": "REMOVED-0",
             "kit_password": ("$2a$12$LiakUCHOpAMvEp9Wxehw5OIlD/TIIP0Bs3blw" "18ePcmKHWWAePrQ."),
             "deposited": False,
             "sample_date": datetime.date(2014, 8, 13),
             "email": "REMOVED",
             "print_results": False,
             "open_humans_token": None,
             "elevation": 0.0,
             "refunded": None,
             "other_text": "REMOVED",
             "barcode": "000018046",
             "swabs_per_kit": 1L,
             "kit_verification_code": "60260",
             "latitude": 0.0,
             "cannot_geocode": None,
             "address": "REMOVED",
             "date_of_last_email": datetime.date(2014, 8, 15),
             "site_sampled": "Stool",
             "name": "REMOVED",
             "sample_time": datetime.time(11, 15),
             "notes": "REMOVED",
             "overloaded": "N",
             "longitude": 0.0,
             "pass_reset_time": None,
             "country": "REMOVED",
             "survey_id": "084532330aca5885",
             "other": "N",
             "sample_barcode_file_md5": None,
         }
     }
예제 #6
0
 def test_get_ag_barcode_details(self):
     obs = db.get_ag_barcode_details(['000018046'])
     ag_login_id = '0060a301-e5bf-6a4e-e050-8a800c5d49b7'
     exp = {'000018046': {
             'ag_kit_barcode_id': '0060a301-e5c1-6a4e-e050-8a800c5d49b7',
             'verification_email_sent': 'n',
             'pass_reset_code': None,
             'vioscreen_status': 3,
             'sample_barcode_file': '000018046.jpg',
             'environment_sampled': None,
             'supplied_kit_id': db.ut_get_supplied_kit_id(ag_login_id),
             'withdrawn': None,
             'kit_verified': 'y',
             # 'city': 'REMOVED',
             'ag_kit_id': '0060a301-e5c0-6a4e-e050-8a800c5d49b7',
             # 'zip': 'REMOVED',
             'ag_login_id': ag_login_id,
             # 'state': 'REMOVED',
             'results_ready': 'Y',
             'moldy': 'N',
             # The key 'registered_on' is a time stamp when the database is
             # created. It is unique per deployment.
             # 'registered_on': datetime.datetime(2016, 8, 17, 10, 47, 2,
             #                                   713292),
             # 'kit_password': ('$2a$10$2.6Y9HmBqUFmSvKCjWmBte70WF.zd3h4Vqb'
             #                  'hLMQK1xP67Aj3rei86'),
             # 'deposited': False,
             'sample_date': datetime.date(2014, 8, 13),
             # 'email': 'REMOVED',
             'print_results': False,
             'open_humans_token': None,
             # 'elevation': 0.0,
             'refunded': None,
             # 'other_text': 'REMOVED',
             'barcode': '000018046',
             'swabs_per_kit': 1L,
             # 'kit_verification_code': '60260',
             # 'latitude': 0.0,
             'cannot_geocode': None,
             # 'address': 'REMOVED',
             'date_of_last_email': datetime.date(2014, 8, 15),
             'site_sampled': 'Stool',
             # 'name': 'REMOVED',
             'sample_time': datetime.time(11, 15),
             # 'notes': 'REMOVED',
             'overloaded': 'N',
             # 'longitude': 0.0,
             'pass_reset_time': None,
             # 'country': 'REMOVED',
             'survey_id': '084532330aca5885',
             'other': 'N',
             'sample_barcode_file_md5': None
     }}
예제 #7
0
 def test_get_ag_barcode_details(self):
     obs = db.get_ag_barcode_details('000001018')
     print obs
예제 #8
0
 def test_get_ag_barcode_details(self):
     obs = db.get_ag_barcode_details('000001018')
     print obs