Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
0cee3c0e
Kaydet (Commit)
0cee3c0e
authored
Mar 07, 2013
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Updated a test that doesn't make sense with autocommit.
üst
423c0d5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
tests.py
tests/transactions_regress/tests.py
+15
-13
No files found.
tests/transactions_regress/tests.py
Dosyayı görüntüle @
0cee3c0e
...
...
@@ -4,7 +4,7 @@ from django.db import connection, connections, transaction, DEFAULT_DB_ALIAS, Da
from
django.db.transaction
import
commit_on_success
,
commit_manually
,
TransactionManagementError
from
django.test
import
TransactionTestCase
,
skipUnlessDBFeature
from
django.test.utils
import
override_settings
from
django.utils.unittest
import
skipIf
,
skipUnless
,
expectedFailure
from
django.utils.unittest
import
skipIf
,
skipUnless
from
transactions.tests
import
IgnorePendingDeprecationWarningsMixin
...
...
@@ -187,22 +187,24 @@ class TestNewConnection(IgnorePendingDeprecationWarningsMixin, TransactionTestCa
connections
[
DEFAULT_DB_ALIAS
]
.
close
()
connections
[
DEFAULT_DB_ALIAS
]
=
self
.
_old_backend
# TODO: update this test to account for database-level autocommit.
@expectedFailure
def
test_commit
(
self
):
"""
Users are allowed to commit and rollback connections.
"""
# The starting value is False, not None.
self
.
assertIs
(
connection
.
_dirty
,
False
)
list
(
Mod
.
objects
.
all
())
self
.
assertTrue
(
connection
.
is_dirty
())
connection
.
commit
()
self
.
assertFalse
(
connection
.
is_dirty
())
list
(
Mod
.
objects
.
all
())
self
.
assertTrue
(
connection
.
is_dirty
())
connection
.
rollback
()
self
.
assertFalse
(
connection
.
is_dirty
())
connection
.
set_autocommit
(
False
)
try
:
# The starting value is False, not None.
self
.
assertIs
(
connection
.
_dirty
,
False
)
list
(
Mod
.
objects
.
all
())
self
.
assertTrue
(
connection
.
is_dirty
())
connection
.
commit
()
self
.
assertFalse
(
connection
.
is_dirty
())
list
(
Mod
.
objects
.
all
())
self
.
assertTrue
(
connection
.
is_dirty
())
connection
.
rollback
()
self
.
assertFalse
(
connection
.
is_dirty
())
finally
:
connection
.
set_autocommit
(
True
)
def
test_enter_exit_management
(
self
):
orig_dirty
=
connection
.
_dirty
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment