Does ZopeFanstaticBrowserLayer set-up the whole grok testing machinery?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Does ZopeFanstaticBrowserLayer set-up the whole grok testing machinery?

Noe Nieto
Hi, I have something like this in myproject/tests/tests.py

import unittest
import doctest

from zope.fanstatic.testing import ZopeFanstaticBrowserLayer

import myproject.tests

browser_layer = ZopeFanstaticBrowserLayer(myproject.tests)

def test_suite():
    suite = unittest.TestSuite()

    test_files = ['app.txt', ]
    optionflags = ( doctest.ELLIPSIS + doctest.NORMALIZE_WHITESPACE + \
                    doctest.REPORT_NDIFF)
    glob_vars = {'getRootFolder': browser_layer.getRootFolder}
    app_test = doctest.DocFileSuite(*test_files,
                                    optionflags = optionflags,
                                    globs=glob_vars)
    app_test.layer = browser_layer

    suite.addTest(app_test)
    return suite

I've been getting some weird test errors related to one of the viewlets we are using not updating recently added content, even If I do an explicit transaction.commit(). I'm kinda confused with this.

So, When running the tests in app.txt with zope.testrunner, does  ZopeFanstaticBrowserLayer set-up the whole grok testing machinery?

--
---
Noe Nieto
NNieto Consulting Services
M: [hidden email]
W: http://noenieto.com
T:  @tzicatl
Li: Perfil en LinkedIn


_______________________________________________
Grok-dev mailing list
[hidden email]
https://mail.zope.org/mailman/listinfo/grok-dev
Reply | Threaded
Open this post in threaded view
|

Re: Does ZopeFanstaticBrowserLayer set-up the whole grok testing machinery?

Alexandre Garel-2
Le 16/11/2011 07:46, Noe Nieto a écrit :

> Hi, I have something like this in myproject/tests/tests.py
>
> import unittest
> import doctest
>
> from zope.fanstatic.testing import ZopeFanstaticBrowserLayer
>
> import myproject.tests
>
> browser_layer = ZopeFanstaticBrowserLayer(myproject.tests)
>
>
--snip--
> So, When running the tests in app.txt with zope.testrunner, does  
> ZopeFanstaticBrowserLayer set-up the whole grok testing machinery?

Sorry for my  knowings in this area are poor, but what is grokked or
setup normally depends on your ftesting.zcml. Did you verify that you
include all needed zcml and/or grok every module needed ?

Alex
_______________________________________________
Grok-dev mailing list
[hidden email]
https://mail.zope.org/mailman/listinfo/grok-dev