Skip to content

Commit 47d1d73

Browse files
claytondaleysaxix
authored andcommitted
- Document new setting
- Fix loaddata test to pass without disabling concurrency - Remove loaddata test that disable concurrency (now redundant)
1 parent 9154ba8 commit 47d1d73

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

docs/settings.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,19 @@ Default: ``CONCURRENCY_LIST_EDITABLE_POLICY_SILENT``
9292

9393
.. _list_editable_policies:
9494

95+
.. setting:: CONCURRENCY_IGNORE_DEFAULT
96+
97+
IGNORE_DEFAULT
98+
--------------
99+
.. versionadded:: >1.2
100+
101+
Default: ``True``
102+
103+
Determines whether a default version number is ignored or used in a concurrency check. While this
104+
configuration defaults to True for backwards compatibility, this setting can cause omitted version
105+
numbers to pass concurrency checks. New implementations are recommended to set this to ``False``.
106+
107+
95108
``CONCURRENCY_LIST_EDITABLE_POLICY_SILENT``
96109
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97110
Used by admin's integrations to handle ``list_editable`` conflicts.

tests/test_loaddata_dumpdata.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,6 @@ def test_loaddata_fail():
3232
data = json.load(open(datafile, 'r'))
3333
pk = data[0]['pk']
3434

35-
with pytest.raises(RecordModifiedError):
36-
call_command('loaddata', datafile, stdout=StringIO())
37-
38-
assert not SimpleConcurrentModel.objects.filter(id=pk).exists()
39-
40-
41-
@pytest.mark.django_db(transaction=False)
42-
def test_loaddata():
43-
datafile = os.path.join(os.path.dirname(__file__), 'dumpdata.json')
44-
data = json.load(open(datafile, 'r'))
45-
pk = data[0]['pk']
46-
47-
# with pytest.raises(RecordModifiedError):
48-
# call_command('loaddata', datafile, stdout=StringIO())
49-
50-
with disable_concurrency():
51-
call_command('loaddata', datafile, stdout=StringIO())
35+
call_command('loaddata', datafile, stdout=StringIO())
5236

5337
assert SimpleConcurrentModel.objects.get(id=pk).username == 'loaded'

0 commit comments

Comments
 (0)