<div dir="ltr"><br><br><div class="gmail_quote">On Sat, Jul 12, 2008 at 6:05 PM, Toni Mueller &lt;<a href="mailto:support@oeko.net">support@oeko.net</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Hi,<br>
<br>
while trying to write some tests for my RDB using application, I found<br>
that I&#39;d like to enforce the specification of the DSN using a TEST_DSN<br>
environment variable, to prevent the unwitting user (eg. me) from<br>
inadvertantly erasing their production database. It was easy to enforce<br>
this, but the side effect is that tests may no longer be run<br>
unattended, since something that would run eg. all tests for all<br>
packages contained in a certain directory tree (think of eg. BSD&#39;s<br>
&quot;make build&quot;), would not know how to set up the test database. I also<br>
can&#39;t simply assume that the test database is SQLite, which is far too<br>
old on my system, but instead have to assume a full PostgreSQL right<br>
now, but that can&#39;t be automagically configured.<br>
<br>
What&#39;s the recommended way to solve this dilemma, please?<br></blockquote><div><br></div><div>i tend to configure the db connections with ... zcml.. and just have a separate zcml string pointing to a test db for the unit test harness.</div>
<div><br></div><div>hth,</div><div><br></div><div>-kapil</div><div>&nbsp;</div></div></div>