Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some style fixes for stuff that was clearly brough tover from doctests.

  • Loading branch information...
commit 150e202172034adb5175663411b15efacca52aae 1 parent cf890c1
Alex Gaynor authored
View
3  tests/regressiontests/transactions_regress/models.py
@@ -1,10 +1,13 @@
from django.db import models
+
class Mod(models.Model):
fld = models.IntegerField()
+
class M2mA(models.Model):
others = models.ManyToManyField('M2mB')
+
class M2mB(models.Model):
fld = models.IntegerField()
View
14 tests/regressiontests/transactions_regress/tests.py
@@ -42,7 +42,7 @@ def test_commit_manually_enforced(self):
@commit_manually
def non_comitter():
"Execute a managed transaction with read-only operations and fail to commit"
- _ = Mod.objects.count()
+ Mod.objects.count()
self.assertRaises(TransactionManagementError, non_comitter)
@@ -56,7 +56,7 @@ def committer():
"""
Perform a database query, then commit the transaction
"""
- _ = Mod.objects.count()
+ Mod.objects.count()
transaction.commit()
try:
@@ -74,7 +74,7 @@ def roller_back():
"""
Perform a database query, then rollback the transaction
"""
- _ = Mod.objects.count()
+ Mod.objects.count()
transaction.rollback()
try:
@@ -90,9 +90,9 @@ def test_commit_manually_enforced_after_commit(self):
@commit_manually
def fake_committer():
"Query, commit, then query again, leaving with a pending transaction"
- _ = Mod.objects.count()
+ Mod.objects.count()
transaction.commit()
- _ = Mod.objects.count()
+ Mod.objects.count()
self.assertRaises(TransactionManagementError, fake_committer)
@@ -239,7 +239,7 @@ def work():
mod = Mod.objects.create(fld=1)
pk = mod.pk
sid = transaction.savepoint()
- mod1 = Mod.objects.filter(pk=pk).update(fld=10)
+ Mod.objects.filter(pk=pk).update(fld=10)
transaction.savepoint_commit(sid)
mod2 = Mod.objects.get(pk=pk)
transaction.commit()
@@ -257,7 +257,7 @@ def work():
mod = Mod.objects.create(fld=1)
pk = mod.pk
sid = transaction.savepoint()
- mod1 = Mod.objects.filter(pk=pk).update(fld=20)
+ Mod.objects.filter(pk=pk).update(fld=20)
transaction.savepoint_rollback(sid)
mod2 = Mod.objects.get(pk=pk)
transaction.commit()
Please sign in to comment.
Something went wrong with that request. Please try again.