Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-mm committed Jan 22, 2024
2 parents 9e7f749 + 8570e09 commit 30ca918
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 3 deletions.
1 change: 1 addition & 0 deletions django/db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from django.utils.connection import ConnectionProxy

__all__ = [
"close_old_connections",
"connection",
"connections",
"router",
Expand Down
2 changes: 1 addition & 1 deletion docs/intro/reusable-apps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ After the previous tutorials, our project should look like this:
static/
polls/
images/
background.gif
background.png
style.css
templates/
polls/
Expand Down
3 changes: 2 additions & 1 deletion docs/ref/databases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ connections.

If a connection is created in a long-running process, outside of Django’s
request-response cycle, the connection will remain open until explicitly
closed, or timeout occurs.
closed, or timeout occurs. You can use ``django.db.close_old_connections()`` to
close all old or unusable connections.

Encoding
--------
Expand Down
2 changes: 1 addition & 1 deletion docs/topics/auth/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ Helper functions
Defaults to :setting:`settings.LOGIN_URL <LOGIN_URL>` if not supplied.

* ``redirect_field_name``: The name of a ``GET`` field containing the
URL to redirect to after log out. Overrides ``next`` if the given
URL to redirect to after login. Overrides ``next`` if the given
``GET`` parameter is passed.

.. _built-in-auth-forms:
Expand Down
83 changes: 83 additions & 0 deletions tests/gis_tests/gdal_tests/test_geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,3 +727,86 @@ def test_is_3d_and_set_3d(self):
msg = "Input to 'set_3d' must be a boolean, got 'None'"
with self.assertRaisesMessage(ValueError, msg):
geom.set_3d(None)

def test_wkt_and_wkb_output(self):
tests = [
# 2D
("POINT (1 2)", "0101000000000000000000f03f0000000000000040"),
(
"LINESTRING (30 10,10 30)",
"0102000000020000000000000000003e400000000000002"
"44000000000000024400000000000003e40",
),
(
"POLYGON ((30 10,40 40,20 40,30 10))",
"010300000001000000040000000000000000003e400000000000002440000000000000"
"44400000000000004440000000000000344000000000000044400000000000003e4000"
"00000000002440",
),
(
"MULTIPOINT (10 40,40 30)",
"0104000000020000000101000000000000000000244000000000000044400101000000"
"00000000000044400000000000003e40",
),
(
"MULTILINESTRING ((10 10,20 20),(40 40,30 30,40 20))",
"0105000000020000000102000000020000000000000000002440000000000000244000"
"0000000000344000000000000034400102000000030000000000000000004440000000"
"00000044400000000000003e400000000000003e400000000000004440000000000000"
"3440",
),
(
"MULTIPOLYGON (((30 20,45 40,10 40,30 20)),((15 5,40 10,10 20,15 5)))",
"010600000002000000010300000001000000040000000000000000003e400000000000"
"0034400000000000804640000000000000444000000000000024400000000000004440"
"0000000000003e40000000000000344001030000000100000004000000000000000000"
"2e40000000000000144000000000000044400000000000002440000000000000244000"
"000000000034400000000000002e400000000000001440",
),
(
"GEOMETRYCOLLECTION (POINT (40 10))",
"010700000001000000010100000000000000000044400000000000002440",
),
# 3D
(
"POINT (1 2 3)",
"0101000080000000000000f03f00000000000000400000000000000840",
),
(
"LINESTRING (30 10 3,10 30 3)",
"0102000080020000000000000000003e40000000000000244000000000000008400000"
"0000000024400000000000003e400000000000000840",
),
(
"POLYGON ((30 10 3,40 40 3,30 10 3))",
"010300008001000000030000000000000000003e400000000000002440000000000000"
"08400000000000004440000000000000444000000000000008400000000000003e4000"
"000000000024400000000000000840",
),
(
"MULTIPOINT (10 40 3,40 30 3)",
"0104000080020000000101000080000000000000244000000000000044400000000000"
"000840010100008000000000000044400000000000003e400000000000000840",
),
(
"MULTILINESTRING ((10 10 3,20 20 3))",
"0105000080010000000102000080020000000000000000002440000000000000244000"
"00000000000840000000000000344000000000000034400000000000000840",
),
(
"MULTIPOLYGON (((30 20 3,45 40 3,30 20 3)))",
"010600008001000000010300008001000000030000000000000000003e400000000000"
"0034400000000000000840000000000080464000000000000044400000000000000840"
"0000000000003e4000000000000034400000000000000840",
),
(
"GEOMETRYCOLLECTION (POINT (40 10 3))",
"0107000080010000000101000080000000000000444000000000000024400000000000"
"000840",
),
]
for geom, wkb in tests:
with self.subTest(geom=geom):
g = OGRGeometry(geom)
self.assertEqual(g.wkt, geom)
self.assertEqual(g.wkb.hex(), wkb)

0 comments on commit 30ca918

Please sign in to comment.