예제 #1
0
 def _show(self):
     if 'user' not in self.current['request']['session']:
         self.current['request']['context']['result']['forms'] = get_form(
             'student_login_form')
     else:
         self.current['request']['context'][
             'show_user_message'] = "Zaten giriş yapmış durumdasınız"
예제 #2
0
def test_simple():
    wfc = workflow_connector()
    session = MockSessionStore()
    req = make_request(session)
    resp = DotDict()
    wfc.on_post(req, resp=resp, wf_name='simple_login')
    assert req['context']['result']['forms'] == get_form('student_login_form')
    req= make_request(session, cmd='do', login_crd={'username':'******', 'password':'******'})
    pprint(session)
    wfc.on_post(req, resp=DotDict(), wf_name='simple_login')
    # print(session)
    # print(req)
    assert session['user']['username'] == 'user'
    assert req['context']['result']['dashboard'] == 'Dashboard'