unit testing newbiew ... and error...

91 views
Skip to first unread message

António Ramos

unread,
Aug 17, 2017, 7:12:20 AM8/17/17
to web...@googlegroups.com
Hello i´m trying to test my web2py app....
Never used any testing before, so be patient..

after reading this 

http://www.web2py.com/AlterEgo/default/show/260

and this 


i tried the code but got this error

Imagem inline 1

i opened globals.py and saw init gets 2 params 
def __init__(self, env):

and the code 
self.request=Request() is missing 1 param..

any help?

regards
António

José Luis Redrejo

unread,
Aug 17, 2017, 7:54:26 AM8/17/17
to web...@googlegroups.com
Antonio, I would not recommend you usint unittest classes, if you read any modern Python testing book or article, they all recommend using pytest.
just in case it can help you.

Regards
José L.

--
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 web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

António Ramos

unread,
Aug 17, 2017, 9:19:26 AM8/17/17
to web...@googlegroups.com
Great
Where can i find some discussion on this file ?
i get an error at line 149

António Ramos

unread,
Aug 17, 2017, 9:20:01 AM8/17/17
to web...@googlegroups.com
Imagem inline 1

António Ramos

unread,
Aug 17, 2017, 12:30:13 PM8/17/17
to web...@googlegroups.com
I deleted the line 
del web2py_env['__file__']

then next error....

Imagem inline 1

disabling the code i then get to the tests execution

My simple test is 

def test_index_exists(client):
    '''page index exists?
    '''
    client.get('people/default/index') 


i get an error from 
Imagem inline 2

Any ideas?

Regards
António

António Ramos

unread,
Aug 17, 2017, 12:43:45 PM8/17/17
to web...@googlegroups.com
seems that removing "people" solves it.



Reply all
Reply to author
Forward
0 new messages