On Fri, Feb 13, 2009 at 8:52 PM, jorge.vargas <[email protected]> wrote:
> While working on http://trac.turbogears.org/ticket/2200
>
> I notice we have an inconsistency. our base controller test class is
> in the quickstart, yet our base model test class (which is what I'm
> replacing, because it's pretty much useless) is in tg.testutil.py, I
> think they should both be in the same place.
>
> And I vote for moving them inside tg.testutil.py and if someone
> needs/wants to change them he/she can subclass in his test.__init__.py
> what do you think?
>

ok after working on this several hours yesterday, I know vote against
me (yes mark I changed opinions again) the reason is actually 3
reasons.

1- in order to setup/teardown the package for testing it's better to
have the classes there with you.
2- we should give max control on how unitesting goes, for example if
people use a model package (using namespaces) they can't use our
testing stuff because that's linked to TGcore. Another example is if
you want a test specific bootstrap, etc.
3- hiding the setup inside the tg package makes it go unnoticed.


the current patch at #2200 uses this method, I'm not 100% happy with
this, it has several flaws.
1- it lacks an obvious way to create bootstrap data (websetup.py is
really bogus, is it for prod, dev or test?)
2- it currently sets up the db runs a test tearsdown, ideally it
should setupdb run ALL model tests teardowndb, setupdb, run ALL
functional tests, teardowndb.
3- it lacks a tests/model package, I'll correct this soon TM.

but, it simplifies the way unitests are setup a lot and provides a
very sane default.

--~--~---------~--~----~------------~-------~--~----~
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