Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Testing dynamic apps
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Russell Keith-Magee  
View profile  
 More options Nov 26 2008, 6:55 pm
From: "Russell Keith-Magee" <freakboy3...@gmail.com>
Date: Thu, 27 Nov 2008 08:55:36 +0900
Local: Wed, Nov 26 2008 6:55 pm
Subject: Re: Testing dynamic apps

On Thu, Nov 27, 2008 at 8:33 AM, Julien Phalip <jpha...@gmail.com> wrote:

> So, all this works pretty well. The 'fakeapp' app is loaded
> dynamically, tables are created and the FakeItem model can be use in
> my tests.

> But it feels dirty. The dynamically created tables can potentially
> clash with some other applications (what if someone calls their app
> 'fakeapp'?). To make it safer maybe I could give a random name to that
> app (e.g. 'uytwe876435gjhgdfs0908').

> Is there a cleaner way to do this? In a similar app (django-voting
> [1]) there is a dedicated test suite, but I'd like to avoid that if
> possible.

You aren't the first person to have this need: this is logged as
ticket #7835. The problem exists for any project that works at the
meta level, working on models rather than with models. For example
contrib.admin needs test models in order to validate that the admin
can display different types of models correctly.

contrib.admin works around the problem by putting the tests in the
Django system test suite, rather than in the contrib app itself. Based
on your description, this sounds like the same approach Django-voting
has used. This approach works fine if you're willing to maintain an
external test suite, but doesn't provide an integrated test suite that
can be easily distributed with your app.

This is one of those problems that I want to solve, but I haven't yet
given a great deal of though into how to solve. I've got a few vague
ideas banging around in my head about allowing test application and
test model definitions to be included in the test module for an
application, but those ideas aren't fully formed. Anyone that wants to
help out with some concrete suggestions (and even better - code) is
more than welcome to do so.

Yours,
Russ Magee %-)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.