canonical-django team mailing list archive
-
canonical-django team
-
Mailing list archive
-
Message #00031
Re: Django testing best practices
James Westby:
> > > I have a related issue of managing things like settings.py in
> > > multiple branches.
> > Doesn't Bazaar just do the right thing, or am I missing something
> > here?
> Well, I currently don't commit the file, as it is supposed to have
> local changes.
This is a tough one, as technically you should be testing your app in
isolation, independent of any project. In django terms the app is more
of a library or a python package/module, and the project is the site
that makes use of it. So you're meant to write isolated apps containing
models, views, template stubs and tags, etc. Then your user sets up a
project containing database configuration, theme assets,and so on.
Keeping the two separate is kind of a thorny business, especially if you
have some historic structure based on your first run. I've taken to
structuring my new repos with two subdirectories: the app, and an
"example" project set up as a demo and test environment.
One advantage to this is that it is dead trivial to turn a truly
standalone app into a Debian package, as it's just another tree of
importable resources in your $PYTHONPATH and maybe some assets in
/usr/share somewhere.
--
Nick Moffitt
References