本文整理汇总了Python中student.models.UserProfile.city方法的典型用法代码示例。如果您正苦于以下问题:Python UserProfile.city方法的具体用法?Python UserProfile.city怎么用?Python UserProfile.city使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类student.models.UserProfile
的用法示例。
在下文中一共展示了UserProfile.city方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from student.models import UserProfile [as 别名]
# 或者: from student.models.UserProfile import city [as 别名]
def setUp(self):
self.test_server_prefix = 'https://testserver'
self.base_organizations_uri = '/api/server/organizations/'
self.base_users_uri = '/api/server/users'
self.base_groups_uri = '/api/server/groups'
self.test_organization_name = str(uuid.uuid4())
self.test_organization_display_name = 'Test Org'
self.test_organization_contact_name = 'John Org'
self.test_organization_contact_email = '[email protected]'
self.test_organization_contact_phone = '+1 332 232 24234'
self.test_user_email = str(uuid.uuid4())
self.test_user_username = str(uuid.uuid4())
self.test_user = User.objects.create(
email=self.test_user_email,
username=self.test_user_username
)
profile = UserProfile(user=self.test_user)
profile.city = 'Boston'
profile.save()
self.course = CourseFactory.create()
self.second_course = CourseFactory.create(
number="899"
)
self.client = SecureClient()
cache.clear()
示例2: setUp
# 需要导入模块: from student.models import UserProfile [as 别名]
# 或者: from student.models.UserProfile import city [as 别名]
def setUp(self):
"""
Create one user and save it to the database
"""
self.user = UserFactory.build(username='test', email='[email protected]')
self.user.set_password('test_password')
self.user.save()
profile = UserProfile(user=self.user)
profile.city = 'Boston'
profile.save()
# Create the test client
self.client = Client()
cache.clear()
self.session_url = '/api/server/sessions'