I'm having the following problem while testing. I'm writing a unit test
for a file upload (using newforms). This works. However, the file gets
written to the same media directory as is used in normal work. I'd prefer
this happened somewhere where it would have no impact on normal
functioning, possibly /tmp. Does anyone have suggestions on what to do?
One workaround would be to redefine the media directory in the tests
themselves, if I can figure out how to do that...
Faheem.
The "normal" would be to have a settings file that is used specifically
for testing. You can put "from normal_settings import *" at the top and
then just override the settings you need to.
It's not always going to be the case that you development, production
and testing settings are identical. So take advantage of the fact you
can have multiple settings files.
Regards,
Malcolm
--
For every action there is an equal and opposite criticism.
http://www.pointy-stick.com/blog/
DATABASE_NAME = os.environ["DATABASE_NAME"]
Cheers,
Amit
ביום ראשון 11 נובמבר 2007, 02:43, נכתב על ידי Malcolm Tredinnick: