當前位置: 首頁>>代碼示例>>Python>>正文


Python ProfileController.profile方法代碼示例

本文整理匯總了Python中h.accounts.views.ProfileController.profile方法的典型用法代碼示例。如果您正苦於以下問題:Python ProfileController.profile方法的具體用法?Python ProfileController.profile怎麽用?Python ProfileController.profile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在h.accounts.views.ProfileController的用法示例。


在下文中一共展示了ProfileController.profile方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_profile_changing_password_with_invalid_data_does_not_update_password

# 需要導入模塊: from h.accounts.views import ProfileController [as 別名]
# 或者: from h.accounts.views.ProfileController import profile [as 別名]
def test_profile_changing_password_with_invalid_data_does_not_update_password():
    user = FakeUser(email=None, password=None)
    request = DummyRequest(post={'__formid__': 'password'},
                           authenticated_user=user)
    controller = ProfileController(request)
    controller.forms['password'] = invalid_form()

    controller.profile()

    assert user.password is None
開發者ID:jasdeep,項目名稱:h,代碼行數:12,代碼來源:views_test.py

示例2: test_profile_changing_password_with_valid_data_updates_password

# 需要導入模塊: from h.accounts.views import ProfileController [as 別名]
# 或者: from h.accounts.views.ProfileController import profile [as 別名]
def test_profile_changing_password_with_valid_data_updates_password():
    user = FakeUser(email=None, password=None)
    request = DummyRequest(post={'__formid__': 'password'},
                           authenticated_user=user)
    controller = ProfileController(request)
    controller.forms['password'] = form_validating_to({'new_password': 'secrets!'})

    controller.profile()

    assert user.password == 'secrets!'
開發者ID:jasdeep,項目名稱:h,代碼行數:12,代碼來源:views_test.py

示例3: test_profile_changing_email_with_valid_data_updates_email

# 需要導入模塊: from h.accounts.views import ProfileController [as 別名]
# 或者: from h.accounts.views.ProfileController import profile [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]'
開發者ID:jasdeep,項目名稱:h,代碼行數:12,代碼來源:views_test.py

示例4: test_profile_changing_password_with_invalid_data_returns_form

# 需要導入模塊: from h.accounts.views import ProfileController [as 別名]
# 或者: from h.accounts.views.ProfileController import profile [as 別名]
def test_profile_changing_password_with_invalid_data_returns_form():
    user = FakeUser(email=None, password=None)
    request = DummyRequest(post={'__formid__': 'password'},
                           authenticated_user=user)
    controller = ProfileController(request)
    controller.forms['password'] = invalid_form()

    result = controller.profile()

    assert 'password_form' in result
開發者ID:jasdeep,項目名稱:h,代碼行數:12,代碼來源:views_test.py

示例5: test_profile_changing_password_with_valid_data_redirects

# 需要導入模塊: from h.accounts.views import ProfileController [as 別名]
# 或者: from h.accounts.views.ProfileController import profile [as 別名]
def test_profile_changing_password_with_valid_data_redirects():
    user = FakeUser(email=None, password=None)
    request = DummyRequest(post={'__formid__': 'password'},
                           authenticated_user=user)
    controller = ProfileController(request)
    controller.forms['password'] = form_validating_to({'new_password': 'secrets!'})

    result = controller.profile()

    assert isinstance(result, httpexceptions.HTTPFound)
開發者ID:jasdeep,項目名稱:h,代碼行數:12,代碼來源:views_test.py


注:本文中的h.accounts.views.ProfileController.profile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。