Skip to content

Commit 77dad7e

Browse files
committed
Rename PSQLEXTRA_ANNOTATE_SQL to POSTGRES_EXTRA_ANNOTATE_SQL
Consistent with other setting names: * `POSTGRES_EXTRA_DB_BACKEND_BASE` * `POSTGRES_EXTRA_AUTO_EXTENSION_SET_UP`
1 parent 99b2c32 commit 77dad7e

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

psqlextra/compiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ def append_caller_to_sql(sql):
4646
Slow and blocking queries could be easily tracked down to their originator
4747
within the source code using the "pg_stat_activity" table.
4848
49-
Enable "PSQLEXTRA_ANNOTATE_SQL" within the database settings to enable this feature.
49+
Enable "POSTGRES_EXTRA_ANNOTATE_SQL" within the database settings to enable this feature.
5050
"""
5151

52-
if not getattr(settings, "PSQLEXTRA_ANNOTATE_SQL", None):
52+
if not getattr(settings, "POSTGRES_EXTRA_ANNOTATE_SQL", None):
5353
return sql
5454

5555
try:

tests/test_append_caller_to_sql.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def mockedFunction():
2222
return append_caller_to_sql("sql")
2323

2424

25-
@override_settings(PSQLEXTRA_ANNOTATE_SQL=False)
25+
@override_settings(POSTGRES_EXTRA_ANNOTATE_SQL=False)
2626
def test_disable_append_caller_to_sql():
2727
commented_sql = mockedFunction()
2828
assert commented_sql == "sql"
@@ -35,23 +35,23 @@ def test_disable_append_caller_to_sql():
3535
psqlextraSimulated().callMockedClass,
3636
],
3737
)
38-
@override_settings(PSQLEXTRA_ANNOTATE_SQL=True)
38+
@override_settings(POSTGRES_EXTRA_ANNOTATE_SQL=True)
3939
def test_append_caller_to_sql_class(entry_point):
4040
commented_sql = entry_point()
4141
assert commented_sql.startswith("sql /* ")
4242
assert "mockedMethod" in commented_sql
4343
assert __file__ in commented_sql
4444

4545

46-
@override_settings(PSQLEXTRA_ANNOTATE_SQL=True)
46+
@override_settings(POSTGRES_EXTRA_ANNOTATE_SQL=True)
4747
def test_append_caller_to_sql_function():
4848
commented_sql = mockedFunction()
4949
assert commented_sql.startswith("sql /* ")
5050
assert "mockedFunction" in commented_sql
5151
assert __file__ in commented_sql
5252

5353

54-
@override_settings(PSQLEXTRA_ANNOTATE_SQL=True)
54+
@override_settings(POSTGRES_EXTRA_ANNOTATE_SQL=True)
5555
def test_append_caller_to_sql_crud():
5656
model = get_fake_model(
5757
{

tests/test_on_conflict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
@pytest.mark.parametrize("conflict_action", ConflictAction.all())
17-
@override_settings(PSQLEXTRA_ANNOTATE_SQL=True)
17+
@override_settings(POSTGRES_EXTRA_ANNOTATE_SQL=True)
1818
def test_on_conflict(conflict_action):
1919
"""Tests whether simple inserts work correctly."""
2020

tests/test_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def test_query_hstore_value_update_escape():
137137
assert inst.title.get("en") == "console.log('test')"
138138

139139

140-
@override_settings(PSQLEXTRA_ANNOTATE_SQL=True)
140+
@override_settings(POSTGRES_EXTRA_ANNOTATE_SQL=True)
141141
def test_query_comment():
142142
"""Tests whether the query is commented."""
143143

tests/test_view_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@pytest.mark.parametrize(
1313
"model_base", [PostgresViewModel, PostgresMaterializedViewModel]
1414
)
15-
@override_settings(PSQLEXTRA_ANNOTATE_SQL=True)
15+
@override_settings(POSTGRES_EXTRA_ANNOTATE_SQL=True)
1616
def test_view_model_meta_query_set(model_base):
1717
"""Tests whether you can set a :see:QuerySet to be used as the underlying
1818
query for a view."""

0 commit comments

Comments
 (0)