1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Tested that get_or_create raises IntegrityError.

It used to raise "DatabaseError: no such savepoint" with the old
transaction management. Closes #15117.
This commit is contained in:
Aymeric Augustin
2013-04-28 17:15:41 +02:00
parent 90fe9141de
commit 3a4276ffc3
2 changed files with 19 additions and 2 deletions

View File

@@ -24,3 +24,7 @@ class Person(models.Model):
class ManualPrimaryKeyTest(models.Model):
id = models.IntegerField(primary_key=True)
data = models.CharField(max_length=100)
class Profile(models.Model):
person = models.ForeignKey(Person, primary_key=True)