Re: Tests fail with django-1.2-rc1

2010-05-11 Thread Dirk Eschler
Am Dienstag 11 Mai 2010, 16:38:40 schrieb Russell Keith-Magee:
> On Tue, May 11, 2010 at 10:21 PM, Dirk Eschler  wrote:
> > Hello,
> > 
> > i'm in the process of upgrading a project to django-1.2-rc1. While the
> > project specific tests passed with django-1.1.1, they all fail now with
> > django-1.2-rc1 (see example below). Any idea what's going wrong?
> 
> At a guess -- you have a model with a custom save() method that isn't
> correctly handling optional arguments. In Django 1.1, save() only took
> two arguments: force_insert=False and force_update=False. Django 1.2
> added a new argument to save (the ``using`` argument) in order to
> handle multiple databases.
> 
> The Django docs recommended [1] using (*args, **kwargs) to allow for
> the addition of future arguments to save(); if you explicitly included
> support for force_insert and force_update, you will need to update
> your save() method to support the new using argument as well (or,
> better still - take the opportunity to migrate to using
> (*args,**kwargs) )

Good guess. :) And thanks for the pointer regarding additional arguments. I 
have fixed my save methods and the tests pass again.

Best Regards,
Dirk Eschler

-- 
Dirk Eschler 
http://www.krusader.org

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Tests fail with django-1.2-rc1

2010-05-11 Thread Russell Keith-Magee
On Tue, May 11, 2010 at 10:21 PM, Dirk Eschler  wrote:
> Hello,
>
> i'm in the process of upgrading a project to django-1.2-rc1. While the project
> specific tests passed with django-1.1.1, they all fail now with django-1.2-rc1
> (see example below). Any idea what's going wrong?

At a guess -- you have a model with a custom save() method that isn't
correctly handling optional arguments. In Django 1.1, save() only took
two arguments: force_insert=False and force_update=False. Django 1.2
added a new argument to save (the ``using`` argument) in order to
handle multiple databases.

The Django docs recommended [1] using (*args, **kwargs) to allow for
the addition of future arguments to save(); if you explicitly included
support for force_insert and force_update, you will need to update
your save() method to support the new using argument as well (or,
better still - take the opportunity to migrate to using
(*args,**kwargs) )

[1] 
http://docs.djangoproject.com/en/1.1/topics/db/models/#overriding-model-methods

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Tests fail with django-1.2-rc1

2010-05-11 Thread Dirk Eschler
Hello,

i'm in the process of upgrading a project to django-1.2-rc1. While the project 
specific tests passed with django-1.1.1, they all fail now with django-1.2-rc1 
(see example below). Any idea what's going wrong?


ERROR: test_content_is_active (foo.bar.tests.MyTestCase)
--
Traceback (most recent call last):
  File "/path/to/myproject/site-packages/foo/bar/tests.py", line 35, in setUp
status=status)
  File "/path/to/myproject/site-packages/django/db/models/manager.py", line 
138, in create
return self.get_query_set().create(**kwargs)
  File "/path/to/myproject/site-packages/django/db/models/query.py", line 352, 
in create
obj.save(force_insert=True, using=self.db)
TypeError: save() got an unexpected keyword argument 'using'


Best Regards,
Dirk Eschler

-- 
Dirk Eschler 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.