Thank you.
I have found this inside:

def is_running_under_test(request, appname):
    if request.get('_running_under_test') or testfile_exists(appname):
        return True
    else:
        return False

But I am not sure what mean both parts of the condition.

I think this run on the TESTED machine, so 2nd part - testfile_exists() 
will cause (I think) that such machine cannot serve non-test requests at 
same time.

So I think more important is the 1st part - request.get(
'_running_under_test')
But how will I set from the TESTING machine request,_running_under_test on 
the TESTED machine?




Dne středa 27. července 2016 16:18:34 UTC+2 Richard napsal(a):
>
> Hello Mirek,
>
> Did you give a look at how web2py.test is doing that?
>
> Bassically, a folder is created with the name of the app when at tests 
> launch if the folder is there the testing database is used...
>
> Richard
>
> On Tue, Jul 26, 2016 at 6:24 AM, Mirek Zvolský <zvo...@seznam.cz 
> <javascript:>> wrote:
>
>> Finally I realized it using
>>
>> session.testing = False / True
>>
>> Because I think the resulting plugin_splinter is interesting (for 
>> somebody),
>> I hope I will publish it and write more later.
>>
>>
>>
>>
>>
>>
>> Dne pondělí 18. července 2016 11:55:57 UTC+2 Mirek Zvolský napsal(a):
>>>
>>> 1.
>>>
>>> I use postgres database dbapp
>>> I am trying to make splinter tests and want to run them over the 2nd 
>>> database dbapp_tests.
>>>
>>> When I switch to the testing database (which is EMPTY include the 
>>> auth_user table)
>>> I am logged in thanks the session:
>>> auth.user and auth.user_id are both set (but auth_user is EMPTY).
>>>
>>> Can I avoid this, without deleting sessions for the normal work?
>>>
>>>
>>>
>>> I have ideas for some workarounds, like:
>>>
>>> - populate dbapp_tests with single auth_user row (mine...)
>>>
>>> - move sessions into database
>>>
>>>
>>>
>>> But I'm asking, if somebody has idea how to switch both databases more 
>>> clever.
>>> Thank you...
>>>
>>>
>>> 2.
>>>
>>> I have no good idea how to easy switch between normal and testing 
>>> database.
>>> At this time I use port (8000/8001), but this works on development, not 
>>> on production.
>>> What is better?
>>>
>>> -- 
>> 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+un...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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

Reply via email to