On Tue, Sep 16, 2008 at 9:48 PM, Jason R. Coombs <[EMAIL PROTECTED]> wrote:

> I notice now there is a test called test_packages.py which
> demonstrates how to re-initialize an elixir model from a package (or
> module) if it's already been cleaned up, specifically by removing the
> module from sys.modules and then reimporting.
>
> The test acknowledges that this is a bit hackish, so I'm curious: Is
> this technique the best way to force Elixir to re-setup entities from
> an imported module for the purposes of unit tests?

It all depends on how much you accept to share between tests. If you
don't want to share anything, it's quite tricky and "reloading" the
module is the only reliable way I've found so far. But in most cases,
it's okay to share the classes and only drop and recreate the tables
so that the data is not shared between tests.

-- 
Gaƫtan de Menten
http://openhex.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to