Commit fa35d2bd authored by Malcolm Tredinnick's avatar Malcolm Tredinnick
Browse files

[1.2.X] Fixed the get_or_create tests for postgreSQL, by using

TransactionTestCase.

Backport of r13814 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13815 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 0c65a6f7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
from datetime import date

from django.db import IntegrityError
from django.test import TestCase
from django.test import TransactionTestCase

from models import Person, ManualPrimaryKeyTest


class GetOrCreateTests(TestCase):
class GetOrCreateTests(TransactionTestCase):
    def test_get_or_create(self):
        p = Person.objects.create(
            first_name='John', last_name='Lennon', birthday=date(1940, 10, 9)