本文整理匯總了Python中h.accounts.views.ProfileController.forms['email']方法的典型用法代碼示例。如果您正苦於以下問題:Python ProfileController.forms['email']方法的具體用法?Python ProfileController.forms['email']怎麽用?Python ProfileController.forms['email']使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類h.accounts.views.ProfileController
的用法示例。
在下文中一共展示了ProfileController.forms['email']方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_profile_changing_email_with_invalid_data_does_not_update_email
# 需要導入模塊: from h.accounts.views import ProfileController [as 別名]
# 或者: from h.accounts.views.ProfileController import forms['email'] [as 別名]
def test_profile_changing_email_with_invalid_data_does_not_update_email():
user = FakeUser(email=None, password=None)
request = DummyRequest(post={'__formid__': 'email'},
authenticated_user=user)
controller = ProfileController(request)
controller.forms['email'] = invalid_form()
controller.profile()
assert user.email is None
示例2: test_profile_changing_email_with_valid_data_redirects
# 需要導入模塊: from h.accounts.views import ProfileController [as 別名]
# 或者: from h.accounts.views.ProfileController import forms['email'] [as 別名]
def test_profile_changing_email_with_valid_data_redirects():
user = FakeUser(email=None, password=None)
request = DummyRequest(post={'__formid__': 'email'},
authenticated_user=user)
controller = ProfileController(request)
controller.forms['email'] = form_validating_to({'email': '[email protected]'})
result = controller.profile()
assert isinstance(result, httpexceptions.HTTPFound)
示例3: test_profile_changing_email_with_invalid_data_returns_form
# 需要導入模塊: from h.accounts.views import ProfileController [as 別名]
# 或者: from h.accounts.views.ProfileController import forms['email'] [as 別名]
def test_profile_changing_email_with_invalid_data_returns_form():
user = FakeUser(email=None, password=None)
request = DummyRequest(post={'__formid__': 'email'},
authenticated_user=user)
controller = ProfileController(request)
controller.forms['email'] = invalid_form()
result = controller.profile()
assert 'email_form' in result
示例4: test_profile_changing_email_with_valid_data_updates_email
# 需要導入模塊: from h.accounts.views import ProfileController [as 別名]
# 或者: from h.accounts.views.ProfileController import forms['email'] [as 別名]
def test_profile_changing_email_with_valid_data_updates_email():
user = FakeUser(email=None, password=None)
request = DummyRequest(post={'__formid__': 'email'},
authenticated_user=user)
controller = ProfileController(request)
controller.forms['email'] = form_validating_to({'email': '[email protected]'})
controller.profile()
assert user.email == '[email protected]'