hi, 

is there any additional code for functional test in https?
example from book works well in http but when try it in https is not work. 
it said :
C:\web2py\applications\testapp\modules>python functional_test.py
No handlers could be found for logger "web2py"
Traceback (most recent call last):
  File "functional_test.py", line 32, in <module>
    assert('Welcome Homer' in client.text)
AssertionError

*e.g. work in http*
#!/usr/bin/env python
# coding: utf8

import sys; sys.path.append('../../../')

from gluon.contrib.webclient import WebClient

client = WebClient('*http://127.0.0.1:8000/testapp/default/*',
                   postbacks=True)

client.get('index')
# register
data = dict(first_name='Homer',
            last_name='Simpson',
            email='[email protected]',
            password='test',
            password_two='test',
            _formname='register')
client.post('user/register', data=data)

# logout
client.get('user/logout')

# login again
data = dict(email='[email protected]',
            password='test',
            _formname='login')
client.post('user/login', data=data)

# check registration and login were successful
client.get('index')
assert('Welcome Homer' in client.text)

*e.g. not work in https*
#!/usr/bin/env python
# coding: utf8

import sys; sys.path.append('../../../')

from gluon.contrib.webclient import WebClient

client = WebClient('*https://127.0.0.1:443/testapp/default/*',
                   postbacks=True)

client.get('index')
# register
data = dict(first_name='Homer',
            last_name='Simpson',
            email='[email protected]',
            password='test',
            password_two='test',
            _formname='register')
client.post('user/register', data=data)

# logout
client.get('user/logout')

# login again
data = dict(email='[email protected]',
            password='test',
            _formname='login')
client.post('user/login', data=data)

# check registration and login were successful
client.get('index')
assert('Welcome Homer' in client.text)

thanks and best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to