Unit tests for form wizard

2009-09-16 Thread AndyH
Any tips on unit testing form wizards using the test client? Other than just faking the name/values for each POST in the wizard, which works, but is a little fiddly. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Forcing content_types.json to be loaded before any other fixtures

2009-01-15 Thread AndyH
On Jan 14, 2:53 am, Russell Keith-Magee wrote: > On Wed, Jan 14, 2009 at 9:34 AM, Giovannetti, Mark > > wrote: > > > Is there a way to force afixtureto be loaded first > > when running manage.py test? > > > I'd like to load a

Re: Serialization of custom model fields

2008-11-15 Thread AndyH
ECTED]> wrote: > There is ticket and patch for this > issuehttp://code.djangoproject.com/ticket/9522 > > On Sat, Nov 15, 2008 at 16:38, AndyH <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I have a custom model field class that stores event recur

Serialization of custom model fields

2008-11-15 Thread AndyH
Hi, I have a custom model field class that stores event recurrence information. In python this is an instance of dateutil.rrule.rule, and in the database I am storing it as an iCal recurrence string. To convert between these two formats I have to_python and get_db_prep_value methods on the

Re: Query for all objects in table1 that DO NOT have corresponding objects in table2

2008-11-15 Thread AndyH
You may want to think about the design of your models as well. Do you really need a separate model for viewed_jobs? Could it just be a boolean field on the Jobs model itself. Otherwise there's a danger of a lot of repetition between the two models. Of course, I don't know your exact use case, so

Confused about unittests and fixtures

2008-11-06 Thread AndyH
Hello, I have the following simple test which demonstrates the confusing behaviour I'm seeing: class AvailabilityTestCase(django.test.TestCase): fixtures = FIXTURE_LIST def setUp(self): response = self.client.login(username='testuser', password='password')

Re: add() method on ManyToManyField

2008-10-01 Thread AndyH
OK... thinking about this, I guess add() on a ManyToManyField is just a wrapper around the save() method of the model your saving it on to. I can do what I need inside save() and that works fine. Probably more transparent as well. Ta. Andy. On Oct 1, 9:13 pm, AndyH <[EMAIL PROTECTED]>

add() method on ManyToManyField

2008-10-01 Thread AndyH
Hello, Is it possible to override the add() method that appears to be on a ManyToManyField attribute. For example: cheese = Topping(name="cheese") cheese.save() pizza.toppings.add( cheese ) I want to override this add method to add extra code before calling the original add(). I tired to do