本文整理汇总了Python中MHLogin.MHLUsers.models.Office_Manager.manager_role方法的典型用法代码示例。如果您正苦于以下问题:Python Office_Manager.manager_role方法的具体用法?Python Office_Manager.manager_role怎么用?Python Office_Manager.manager_role使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MHLogin.MHLUsers.models.Office_Manager
的用法示例。
在下文中一共展示了Office_Manager.manager_role方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testSetOfficeStaffResultList
# 需要导入模块: from MHLogin.MHLUsers.models import Office_Manager [as 别名]
# 或者: from MHLogin.MHLUsers.models.Office_Manager import manager_role [as 别名]
def testSetOfficeStaffResultList(self):
# create office staff
staff = create_office_staff(get_random_username(), "staff", "thj", "demo",
"555 Bryant St.", "Palo Alto", "CA", "", uklass=OfficeStaff)
staff2 = create_office_staff(get_random_username(), "nurse", "thj", "demo",
"555 Bryant St.", "Palo Alto", "CA", "", uklass=OfficeStaff)
nurse = Nurse(user=staff2)
nurse.save()
staff3 = create_office_staff(get_random_username(), "maneger", "thj", "demo",
"555 Bryant St.", "Palo Alto", "CA", "", uklass=OfficeStaff)
mgr = Office_Manager(user=staff3)
practice = PracticeLocation(
practice_address1='555 Pleasant Pioneer Grove',
practice_address2='Trailer Q615',
practice_city='Mountain View',
practice_state='CA',
practice_zip='94040-4104',
practice_lat=37.36876,
practice_longit=-122.081864)
practice.save()
mgr.manager_role = 1
mgr.practice = practice
mgr.save()
mhlu = create_user(get_random_username(), "mhluser", "thj", "demo",
"555 Bryant St.", "Palo Alto", "CA", "")
mhlu.mdcom_phone = '9002000001'
mhlu.save()
self.assertEqual(0, len(setOfficeStaffResultList([])),
'test failed for setOfficeStaffResultList null')
self.assertEqual(1, len(setOfficeStaffResultList([staff])),
'test failed for setOfficeStaffResultList staff')
# self.assertEqual(1, len(setOfficeStaffResultList([nurse])),
#'test failed for setOfficeStaffResultList nurse')
self.assertEqual(1, len(setOfficeStaffResultList([mgr])),
'test failed for setOfficeStaffResultList mgr')
self.assertEqual(3, len(setOfficeStaffResultList([staff, nurse.user, mgr])),
'test failed for setOfficeStaffResultList')
self.assertEqual(3, len(setOfficeStaffResultList([staff, nurse.user, mgr], staff)),
'test failed for setOfficeStaffResultList')
示例2: testGetUserInfo
# 需要导入模块: from MHLogin.MHLUsers.models import Office_Manager [as 别名]
# 或者: from MHLogin.MHLUsers.models.Office_Manager import manager_role [as 别名]
def testGetUserInfo(self):
mhlu = create_user(get_random_username(), "mhluser", "thj", "demo", "555 Bryant St.",
"Palo Alto", "CA", "")
mhlu.mdcom_phone = '9002000001'
mhlu.save()
mhlu_id = mhlu.id
return_data1 = {'last_name': u'thj', 'office_address1': u'555 Bryant St.',
'office_address2': u'', 'photo': '/media/images/photos/generic_128.png',
'specialty': '', 'mdcom_phone': '', 'office_city': u'Palo Alto',
'accepting_patients': False, 'id': mhlu_id, 'custom_logos': get_custom_logos(mhlu_id),
'first_name': u'mhluser', 'office_state': u'CA', 'office_zip': u'', 'staff_type': ''}
self.assertEqual(Http404, getUserInfo(mhlu_id + 1, None), 'test failed for getUserInfo')
self.assertEqual(return_data1, getUserInfo(mhlu_id), 'test failed for getUserInfo mhluser')
# create provider for test
provider = create_user(get_random_username(), "provider", "thj", "demo",
"555 Bryant St.", "Palo Alto", "CA", "", uklass=Provider)
provider.mdcom_phone = '9002000002'
provider.save()
return_data2 = {'last_name': u'thj', 'office_address1': u'555 Bryant St.',
'office_address2': u'', 'photo': '/media/images/photos/avatar2.png',
'specialty': 'NP/PA/Midwife', 'mdcom_phone': u'9002000002', 'office_city': u'Palo Alto',
'accepting_patients': False, 'id': provider.user.id,
'custom_logos': get_custom_logos(mhlu_id), 'first_name': u'provider',
'office_state': u'CA', 'office_zip': u'', 'staff_type': ''}
self.assertEqual(return_data2, getUserInfo(provider.user.id), 'test failed for getUserInfo provider')
# create physician
provider1 = create_user(get_random_username(), "physician", "thj", "demo", "555 Bryant St.",
"Palo Alto", "CA", "", uklass=Provider)
provider1.mdcom_phone = '9002000002'
provider1.save()
phy = Physician(user=provider1)
phy.specialty = 'AC'
phy.save()
return_data3 = {'last_name': u'thj', 'office_address1': u'555 Bryant St.',
'office_address2': u'', 'photo': '/media/images/photos/avatar2.png',
'specialty': u'Acupuncture', 'mdcom_phone': u'9002000002',
'office_city': u'Palo Alto', 'accepting_patients': True,
'id': phy.user.user.id, 'custom_logos': get_custom_logos(mhlu_id),
'first_name': u'physician', 'office_state': u'CA', 'office_zip': u'',
'staff_type': ''}
self.assertEqual(return_data3, getUserInfo(phy.user.user.id), 'test failed for getUserInfo physician')
# create office staff
staff = create_office_staff(get_random_username(), "staff", "thj", "demo", "555 Bryant St.",
"Palo Alto", "CA", "", uklass=OfficeStaff)
return_data4 = {'last_name': u'thj', 'office_address1': u'555 Bryant St.',
'office_address2': u'', 'photo': '/media/images/photos/staff_icon.jpg',
'specialty': '', 'mdcom_phone': '', 'office_city': u'Palo Alto',
'accepting_patients': False, 'id': staff.user.id,
'custom_logos': get_custom_logos(mhlu_id), 'first_name': u'staff',
'office_state': u'CA', 'office_zip': u'', 'staff_type': 'Office Staff'}
self.assertEqual(return_data4, getUserInfo(staff.user.id), 'test failed for getUserInfo staff')
# create nurse
staff2 = create_office_staff(get_random_username(), "nurse", "thj", "demo",
"555 Bryant St.", "Palo Alto", "CA", "", uklass=OfficeStaff)
nurse = Nurse(user=staff2)
nurse.save()
return_data5 = {'last_name': u'thj', 'office_address1': u'555 Bryant St.',
'office_address2': u'', 'photo': '/media/images/photos/nurse.jpg',
'specialty': '', 'mdcom_phone': '', 'office_city': u'Palo Alto',
'accepting_patients': False, 'id': nurse.user.user.id,
'custom_logos': get_custom_logos(mhlu_id), 'first_name': u'nurse',
'office_state': u'CA', 'office_zip': u'', 'staff_type': 'Office Staff'}
self.assertEqual(return_data5, getUserInfo(nurse.user.user.id), 'test failed for getUserInfo nurse')
# create office staff
staff3 = create_office_staff(get_random_username(), "maneger", "thj", "demo",
"555 Bryant St.", "Palo Alto", "CA", "", uklass=OfficeStaff)
mgr = Office_Manager(user=staff3)
practice = PracticeLocation(
practice_address1='555 Pleasant Pioneer Grove',
practice_address2='Trailer Q615',
practice_city='Mountain View',
practice_state='CA',
practice_zip='94040-4104',
practice_lat=37.36876,
practice_longit=-122.081864)
practice.save()
mgr.manager_role = 1
mgr.practice = practice
mgr.save()
return_data5 = {'last_name': u'thj', 'office_address1': u'555 Bryant St.',
'office_address2': u'', 'photo': '/media/images/photos/staff_icon.jpg',
'specialty': '', 'mdcom_phone': '', 'office_city': u'Palo Alto',
'accepting_patients': False, 'id': mgr.user.user.id,
'custom_logos': get_custom_logos(mhlu_id), 'first_name': u'maneger',
'office_state': u'CA', 'office_zip': u'', 'staff_type': 'Office Manager'}
self.assertEqual(return_data5, getUserInfo(mgr.user.user.id), 'test failed for getUserInfo maneger')