sebastian-ardila / google-app-engine-django

Automatically exported from code.google.com/p/google-app-engine-django
Apache License 2.0
0 stars 0 forks source link

Problem installing fixture in test, error "got an unexpected keyword argument 'using'" #183

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Write test with using fixture
class Views_NextCallTestCase(TestCase):
    fixtures = ['some.json']

    def test_fixtures(self):
          pass

c:\projects\repos\mypersonal\y2010\sibitel010>python
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.VERSION
(1, 2, 3, 'final', 0)

appengine_django - VERSION=109 TIMESTAMP=1288172695

try run test with fixture:
c:\projects\repos\mypersonal\y2010\sibitel010>manage.py test clients.Views_NextC
allTestCase

Problem installing fixture 'c:\projects\repos\mypersonal\y2010\sibitel010\client
s\fixtures\clients_010.json': Traceback (most recent call last):
  File "c:\projects\repos\mypersonal\y2010\sibitel010\django\core\management\com
mands\loaddata.py", line 172, in handle
    obj.save(using=using)
TypeError: save() got an unexpected keyword argument 'using'

What version of the product are you using? On what operating system?
os: win xp

Original issue reported on code.google.com by apocheku...@gmail.com on 1 Nov 2010 at 3:19

GoogleCodeExporter commented 9 years ago
Same error on Ubuntu 10.04 with Django 1.2.3.

1. python2.5 manage.py shell
2. Create some data in the datastore. Anything so that it's not empty.
3. python2.5 manage.py dumpdata --indent 4 > 
apps/exersize/fixtures/exersizes.json
4. Some manual modifications to the json so that it behaves with my 
StringListProperty.
5. python2.5 manage.py loaddata apps/exersize/fixtures/exersizes.json

Problem installing fixture 
'/home/chris/devspace/fitnesshacking/gae/apps/exersize/fixtures/exersizes.json':
 Traceback (most recent call last):
  File "/home/chris/devspace/fitnesshacking/gae/django.zip/django/core/management/commands/loaddata.py", line 172, in handle
    obj.save(using=using)
TypeError: save() got an unexpected keyword argument 'using'

I've gotten past the error by modifying 'appengine_django/__init__.py' on line 
333.

def save(self, save_m2m=True):
becomes
def save(self, save_m2m=True, using=None):

I proceed to not do anything with the 'using' parameter (same as the existing 
save_m2m). It looks related to Django 1.2's new multi database support and thus 
irrelevant to app engine. Caveat Emptor.

Original comment by cher...@gmail.com on 15 Nov 2010 at 4:10

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r112.

Original comment by m...@google.com on 18 Nov 2010 at 6:47