On Mon, Oct 20, 2008 at 12:03 PM, Doug Latornell <[EMAIL PROTECTED]> wrote:
>
> I've been looking at ticket #1945 because it implies a change to the
> test modules in the quickstart templates, so it should be addressed
> before TG2 b1 - yes?  I've moved the code, but there is a problem with
> the code that initializes the application via websetup with the
> project's test.ini configuration file:
>
>    app_dir = os.path.dirname(config['package'].__path__[0])
>    ...
>    test_file = os.path.join(app_dir, 'test.ini')
>    SetupCommand('setup-app').run([test_file])
>
> This has to be module level code so that it is only executed once.
> Running the tg2 unit test in test_testutil.py cause this code to be
> executed, but in that context config['package'] is not defined.
> Wrapping the code about in a try: ... except KeyError block avoid the
> error, but doesn't feel like the correct solution.
> Can anyone point me in the right direction to resolve this?
>
I'm actually -0 on this I think TestController, as well as DBTest
should be  modifiable by the user. for example i got a project where
we are not running setup-app, so we just replaced the call for
SetupCommand.

the problem you have is that TG is loaded before the application, so
it can't find the app place. The second problem is that paste config
demands a full path to the file in place. so the only way I can think
this could be fix will be to make it a function and call it after the
app has finish loading.

the reason why I'm not -1 on this is because I think the quickstarted
project is already way too big and if we could find a way to make it
smaller (IE, having inheritance to overwrite the defaults, or passing
in parameters) I'm +1 on that.

> Doug
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to