Permalink
Browse files

[1.2.X] Fixed a bunch more tests that were failing in Oracle due to f…

…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...
1 parent 317f30a commit ec7dd583f2b33aa9a575530fbec215426348fdf6 @ikelly ikelly committed Mar 10, 2011
@@ -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)
@@ -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
@@ -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(), [
Oops, something went wrong.

0 comments on commit ec7dd58

Please sign in to comment.