Skip to content

Commit

Permalink
[1.2.X] Fixed a bunch more tests that were failing in Oracle due to f…
Browse files Browse the repository at this point in the history
…alse assumptions about the primary keys of objects.

Backport of r15789 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15790 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
nightflyerkilo committed Mar 10, 2011
1 parent 317f30a commit ec7dd58
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 119 deletions.
2 changes: 1 addition & 1 deletion tests/modeltests/field_subclassing/tests.py
Expand Up @@ -55,7 +55,7 @@ def test_custom_field(self):

# Serialization works, too.
stream = serializers.serialize("json", MyModel.objects.all())
self.assertEqual(stream, '[{"pk": 1, "model": "field_subclassing.mymodel", "fields": {"data": "12", "name": "m"}}]')
self.assertEqual(stream, '[{"pk": %d, "model": "field_subclassing.mymodel", "fields": {"data": "12", "name": "m"}}]' % m1.pk)

obj = list(serializers.deserialize("json", stream))[0]
self.assertEqual(obj.object, m)
Expand Down
2 changes: 2 additions & 0 deletions tests/modeltests/fixtures/tests.py
Expand Up @@ -3,6 +3,7 @@

from django.test import TestCase, TransactionTestCase
from django.conf import settings
from django.contrib.sites.models import Site
from django.core import management
from django.db import DEFAULT_DB_ALIAS

Expand Down Expand Up @@ -38,6 +39,7 @@ def test_initial_data(self):
def test_loading_and_dumping(self):
new_io = StringIO.StringIO()

Site.objects.all().delete()
# Load fixture 1. Single JSON file, with two objects.
management.call_command('loaddata', 'fixture1.json', verbosity=0, commit=False)
self.assertQuerysetEqual(Article.objects.all(), [
Expand Down

0 comments on commit ec7dd58

Please sign in to comment.