当前位置: 首页>>代码示例>>Python>>正文


Python Office_Manager.practice方法代码示例

本文整理汇总了Python中MHLogin.MHLUsers.models.Office_Manager.practice方法的典型用法代码示例。如果您正苦于以下问题:Python Office_Manager.practice方法的具体用法?Python Office_Manager.practice怎么用?Python Office_Manager.practice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MHLogin.MHLUsers.models.Office_Manager的用法示例。


在下文中一共展示了Office_Manager.practice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_display_scheduler_nopractice

# 需要导入模块: from MHLogin.MHLUsers.models import Office_Manager [as 别名]
# 或者: from MHLogin.MHLUsers.models.Office_Manager import practice [as 别名]
	def test_display_scheduler_nopractice(self):
		dataEmpty = {}
		staff = OfficeStaff(user=self.user)
		staff.save()
		staff.practices.add(self.practice)
		manager = Office_Manager(user=staff, practice=self.practice, manager_role=2)
		manager.save()
		practice2 = PracticeLocation(practice_name='test2',
								practice_longit='0.1',
								practice_lat='0.0',)
		practice2.save()
		manager.practice = practice2
		manager.save()
		response = self.client.get(reverse('MHLogin.MHLCallGroups.Scheduler.'\
			'views_multicallgroup.display_scheduler', args=(practice2.id, 0)), data=dataEmpty)
		self.assertEqual(response.status_code, 200)
		self.assertTemplateUsed(response, 'error_multicallgroup.html')
开发者ID:DongHuaLu,项目名称:mdcom,代码行数:19,代码来源:test_views_multicallgroup.py

示例2: testSetOfficeStaffResultList

# 需要导入模块: from MHLogin.MHLUsers.models import Office_Manager [as 别名]
# 或者: from MHLogin.MHLUsers.models.Office_Manager import practice [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')
开发者ID:DongHuaLu,项目名称:mdcom,代码行数:43,代码来源:tests_utils_users.py

示例3: testGetUserInfo

# 需要导入模块: from MHLogin.MHLUsers.models import Office_Manager [as 别名]
# 或者: from MHLogin.MHLUsers.models.Office_Manager import practice [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')
开发者ID:DongHuaLu,项目名称:mdcom,代码行数:96,代码来源:tests_utils_users.py


注:本文中的MHLogin.MHLUsers.models.Office_Manager.practice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。