open-api-framework 0.9.5__tar.gz → 0.10.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/CHANGELOG.rst +21 -0
  2. {open_api_framework-0.9.5/open_api_framework.egg-info → open_api_framework-0.10.0}/PKG-INFO +4 -2
  3. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/README.rst +1 -1
  4. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/conf/base.py +23 -5
  5. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/conf/utils.py +37 -0
  6. {open_api_framework-0.9.5 → open_api_framework-0.10.0/open_api_framework.egg-info}/PKG-INFO +4 -2
  7. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework.egg-info/requires.txt +2 -0
  8. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/pyproject.toml +4 -2
  9. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/tests/test_generate_envvar_docs.py +22 -16
  10. open_api_framework-0.10.0/tests/test_settings.py +26 -0
  11. open_api_framework-0.9.5/tests/test_settings.py +0 -8
  12. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/LICENSE +0 -0
  13. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/MANIFEST.in +0 -0
  14. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/__init__.py +0 -0
  15. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/admin.py +0 -0
  16. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/apps.py +0 -0
  17. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/conf/__init__.py +0 -0
  18. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/context_processors.py +0 -0
  19. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/management/__init__.py +0 -0
  20. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/management/commands/__init__.py +0 -0
  21. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/management/commands/generate_envvar_docs.py +0 -0
  22. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/py.typed +0 -0
  23. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/static/open_api_framework/css/admin.css +0 -0
  24. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/templates/open_api_framework/admin/base_site.html +0 -0
  25. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/templates/open_api_framework/components/environment.html +0 -0
  26. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/templates/open_api_framework/components/version.html +0 -0
  27. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/templates/open_api_framework/env_config.rst +0 -0
  28. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/templatetags/__init__.py +0 -0
  29. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/templatetags/doc_tags.py +0 -0
  30. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/templatetags/open_api_framework.py +0 -0
  31. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework/utils.py +0 -0
  32. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework.egg-info/SOURCES.txt +0 -0
  33. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework.egg-info/dependency_links.txt +0 -0
  34. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/open_api_framework.egg-info/top_level.txt +0 -0
  35. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/setup.cfg +0 -0
  36. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/tests/test_admin.py +0 -0
  37. {open_api_framework-0.9.5 → open_api_framework-0.10.0}/tests/test_config_helpers.py +0 -0
@@ -1,6 +1,27 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 0.10.0 (2025-05-19)
5
+ -------------------
6
+
7
+ **New features**
8
+
9
+ * Add separate "Logging" group for logging related environment variables in docs
10
+ * Add ``open_api_framework.conf.utils.mute_logging`` util to silence logging in CI
11
+ * [maykinmedia/objects-api#592] Silence log events in Sentry if structlog is used
12
+
13
+ **Bugfixes**
14
+
15
+ * [#127] Make ``LOGIN_URL`` non-lazy to avoid errors when using ``django-rosetta``
16
+
17
+ 0.9.6 (2025-03-28)
18
+ ------------------
19
+
20
+ **Maintenance**
21
+
22
+ * [#59] Set ``SITE_DOMAIN`` default to an empty string and add ``SITE_ID``
23
+
24
+
4
25
  0.9.5 (2025-03-24)
5
26
  ------------------
6
27
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: open-api-framework
3
- Version: 0.9.5
3
+ Version: 0.10.0
4
4
  Summary: A metapackage for registration components, that bundles the dependencies shared between these components and provides generic settings
5
5
  Author-email: Maykin Media <support@maykinmedia.nl>
6
6
  License: Copyright © Maykin 2024
@@ -69,6 +69,8 @@ Requires-Dist: isort; extra == "tests"
69
69
  Requires-Dist: black; extra == "tests"
70
70
  Requires-Dist: flake8; extra == "tests"
71
71
  Requires-Dist: factory-boy; extra == "tests"
72
+ Requires-Dist: django-rosetta; extra == "tests"
73
+ Requires-Dist: django-webtest; extra == "tests"
72
74
  Provides-Extra: coverage
73
75
  Requires-Dist: pytest-cov; extra == "coverage"
74
76
  Provides-Extra: docs
@@ -82,7 +84,7 @@ Dynamic: license-file
82
84
  Open API Framework
83
85
  ==================
84
86
 
85
- :Version: 0.9.5
87
+ :Version: 0.10.0
86
88
  :Source: https://github.com/maykinmedia/open-api-framework
87
89
  :Keywords: metapackage, dependencies
88
90
 
@@ -1,7 +1,7 @@
1
1
  Open API Framework
2
2
  ==================
3
3
 
4
- :Version: 0.9.5
4
+ :Version: 0.10.0
5
5
  :Source: https://github.com/maykinmedia/open-api-framework
6
6
  :Keywords: metapackage, dependencies
7
7
 
@@ -29,6 +29,11 @@ BASE_DIR = Path(DJANGO_PROJECT_DIR).resolve().parents[1]
29
29
  #
30
30
  # Core Django settings
31
31
  #
32
+ SITE_ID = config(
33
+ "SITE_ID",
34
+ default=1,
35
+ help_text="The database ID of the site object. You usually won't have to touch this.",
36
+ )
32
37
 
33
38
  # SECURITY WARNING: keep the secret key used in production secret!
34
39
  SECRET_KEY = config(
@@ -342,7 +347,10 @@ DEFAULT_FROM_EMAIL = config(
342
347
  # LOGGING
343
348
  #
344
349
  LOG_STDOUT = config(
345
- "LOG_STDOUT", default=True, help_text="whether to log to stdout or not"
350
+ "LOG_STDOUT",
351
+ default=True,
352
+ help_text="whether to log to stdout or not",
353
+ group="Logging",
346
354
  )
347
355
  LOG_LEVEL = config(
348
356
  "LOG_LEVEL",
@@ -351,6 +359,7 @@ LOG_LEVEL = config(
351
359
  "control the verbosity of logging output. "
352
360
  "Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``"
353
361
  ),
362
+ group="Logging",
354
363
  )
355
364
  LOG_QUERIES = config(
356
365
  "LOG_QUERIES",
@@ -359,9 +368,14 @@ LOG_QUERIES = config(
359
368
  "enable (query) logging at the database backend level. Note that you "
360
369
  "must also set ``DEBUG=1``, which should be done very sparingly!"
361
370
  ),
371
+ group="Logging",
362
372
  )
373
+ # XXX: this should be renamed to `LOG_OUTGOING_REQUESTS` in the next major release
363
374
  LOG_REQUESTS = config(
364
- "LOG_REQUESTS", default=False, help_text="enable logging of the outgoing requests"
375
+ "LOG_REQUESTS",
376
+ default=False,
377
+ help_text="enable logging of the outgoing requests",
378
+ group="Logging",
365
379
  )
366
380
  if LOG_QUERIES and not DEBUG:
367
381
  warnings.warn(
@@ -374,6 +388,7 @@ CELERY_LOGLEVEL = config(
374
388
  default="INFO",
375
389
  help_text="control the verbosity of logging output for celery, independent of ``LOG_LEVEL``."
376
390
  " Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``",
391
+ group="Celery",
377
392
  )
378
393
 
379
394
  LOGGING_DIR = Path(BASE_DIR) / "log"
@@ -559,8 +574,7 @@ SESSION_COOKIE_AGE = config(
559
574
  help_text="For how long, in seconds, the session cookie will be valid.",
560
575
  )
561
576
 
562
-
563
- LOGIN_URL = reverse_lazy("admin:login")
577
+ LOGIN_URL = "admin:login"
564
578
  LOGIN_REDIRECT_URL = reverse_lazy("admin:index")
565
579
  LOGOUT_REDIRECT_URL = reverse_lazy("admin:index")
566
580
 
@@ -799,7 +813,7 @@ NOTIFICATIONS_DISABLED = config(
799
813
  )
800
814
  SITE_DOMAIN = config(
801
815
  "SITE_DOMAIN",
802
- default="example.com",
816
+ default="",
803
817
  help_text=("Defines the primary domain where the application is hosted."),
804
818
  )
805
819
 
@@ -948,22 +962,26 @@ LOG_OUTGOING_REQUESTS_EMIT_BODY = config(
948
962
  "LOG_OUTGOING_REQUESTS_EMIT_BODY",
949
963
  default=True,
950
964
  help_text="Whether or not outgoing request bodies should be logged",
965
+ group="Logging",
951
966
  )
952
967
  LOG_OUTGOING_REQUESTS_DB_SAVE = config(
953
968
  "LOG_OUTGOING_REQUESTS_DB_SAVE",
954
969
  default=False,
955
970
  help_text="Whether or not outgoing request logs should be saved to the database",
971
+ group="Logging",
956
972
  )
957
973
  LOG_OUTGOING_REQUESTS_DB_SAVE_BODY = config(
958
974
  "LOG_OUTGOING_REQUESTS_DB_SAVE_BODY",
959
975
  default=True,
960
976
  help_text="Whether or not outgoing request bodies should be saved to the database",
977
+ group="Logging",
961
978
  )
962
979
  LOG_OUTGOING_REQUESTS_RESET_DB_SAVE_AFTER = None
963
980
  LOG_OUTGOING_REQUESTS_MAX_AGE = config(
964
981
  "LOG_OUTGOING_REQUESTS_MAX_AGE",
965
982
  default=7,
966
983
  help_text="The amount of time after which request logs should be deleted from the database",
984
+ group="Logging",
967
985
  ) # number of days
968
986
 
969
987
 
@@ -1,3 +1,4 @@
1
+ import logging # noqa: TID251
1
2
  import sys
2
3
  from dataclasses import dataclass
3
4
  from pathlib import Path
@@ -6,6 +7,7 @@ from urllib.parse import urlparse
6
7
 
7
8
  from decouple import Csv, Undefined, config as _config, undefined
8
9
  from sentry_sdk.integrations import DidNotEnable, django, redis
10
+ from sentry_sdk.integrations.logging import LoggingIntegration
9
11
 
10
12
 
11
13
  @dataclass
@@ -103,6 +105,20 @@ def get_sentry_integrations() -> list:
103
105
  else:
104
106
  extra.append(celery.CeleryIntegration())
105
107
 
108
+ try:
109
+ import structlog # type: ignore # noqa
110
+ except ImportError:
111
+ pass
112
+ else:
113
+ extra.append(
114
+ LoggingIntegration(
115
+ level=logging.INFO, # breadcrumbs
116
+ # do not send any logs as event to Sentry at all - these must be scraped by
117
+ # the (container) infrastructure instead.
118
+ event_level=None,
119
+ ),
120
+ )
121
+
106
122
  return [*default, *extra]
107
123
 
108
124
 
@@ -119,3 +135,24 @@ def get_django_project_dir() -> str:
119
135
  # Get the path of the importing module
120
136
  base_dirname = get_project_dirname()
121
137
  return Path(sys.modules[base_dirname].__file__).parent
138
+
139
+
140
+ def mute_logging(config: dict) -> None: # pragma: no cover
141
+ """
142
+ Disable (console) output from logging.
143
+ :arg config: The logging config, typically the django LOGGING setting.
144
+ """
145
+
146
+ # set up the null handler for all loggers so that nothing gets emitted
147
+ for name, logger in config["loggers"].items():
148
+ if name == "flaky_tests":
149
+ continue
150
+ logger["handlers"] = ["null"]
151
+
152
+ # some tooling logs to a logger which isn't defined, and that ends up in the root
153
+ # logger -> add one so that we can mute that output too.
154
+ config["loggers"].update(
155
+ {
156
+ "": {"handlers": ["null"], "level": "CRITICAL", "propagate": False},
157
+ }
158
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: open-api-framework
3
- Version: 0.9.5
3
+ Version: 0.10.0
4
4
  Summary: A metapackage for registration components, that bundles the dependencies shared between these components and provides generic settings
5
5
  Author-email: Maykin Media <support@maykinmedia.nl>
6
6
  License: Copyright © Maykin 2024
@@ -69,6 +69,8 @@ Requires-Dist: isort; extra == "tests"
69
69
  Requires-Dist: black; extra == "tests"
70
70
  Requires-Dist: flake8; extra == "tests"
71
71
  Requires-Dist: factory-boy; extra == "tests"
72
+ Requires-Dist: django-rosetta; extra == "tests"
73
+ Requires-Dist: django-webtest; extra == "tests"
72
74
  Provides-Extra: coverage
73
75
  Requires-Dist: pytest-cov; extra == "coverage"
74
76
  Provides-Extra: docs
@@ -82,7 +84,7 @@ Dynamic: license-file
82
84
  Open API Framework
83
85
  ==================
84
86
 
85
- :Version: 0.9.5
87
+ :Version: 0.10.0
86
88
  :Source: https://github.com/maykinmedia/open-api-framework
87
89
  :Keywords: metapackage, dependencies
88
90
 
@@ -48,3 +48,5 @@ isort
48
48
  black
49
49
  flake8
50
50
  factory-boy
51
+ django-rosetta
52
+ django-webtest
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "open-api-framework"
7
- version = "0.9.5"
7
+ version = "0.10.0"
8
8
  description = "A metapackage for registration components, that bundles the dependencies shared between these components and provides generic settings"
9
9
  authors = [
10
10
  {name = "Maykin Media", email = "support@maykinmedia.nl"}
@@ -75,6 +75,8 @@ tests = [
75
75
  "black",
76
76
  "flake8",
77
77
  "factory-boy",
78
+ "django-rosetta",
79
+ "django-webtest"
78
80
  ]
79
81
  coverage = [
80
82
  "pytest-cov",
@@ -109,7 +111,7 @@ env = [
109
111
  ]
110
112
 
111
113
  [tool.bumpversion]
112
- current_version = "0.9.5"
114
+ current_version = "0.10.0"
113
115
  files = [
114
116
  {filename = "pyproject.toml"},
115
117
  {filename = "README.rst"},
@@ -35,21 +35,35 @@ Database
35
35
  * ``DB_PORT``: port number of the database. Defaults to: ``5432``.
36
36
 
37
37
 
38
- Cross-Origin-Resource-Sharing
39
- -----------------------------
38
+ Logging
39
+ -------
40
40
 
41
- * ``CORS_ALLOW_ALL_ORIGINS``: allow cross-domain access from any client. Defaults to: ``False``.
42
- * ``CORS_ALLOWED_ORIGINS``: explicitly list the allowed origins for cross-domain requests. Example: http://localhost:3000,https://some-app.gemeente.nl. Defaults to: ``[]``.
43
- * ``CORS_ALLOWED_ORIGIN_REGEXES``: same as ``CORS_ALLOWED_ORIGINS``, but supports regular expressions. Defaults to: ``[]``.
44
- * ``CORS_EXTRA_ALLOW_HEADERS``: headers that are allowed to be sent as part of the cross-domain request. By default, Authorization, Accept-Crs and Content-Crs are already included. The value of this variable is added to these already included headers. Defaults to: ``[]``.
41
+ * ``LOG_STDOUT``: whether to log to stdout or not. Defaults to: ``True``.
42
+ * ``LOG_LEVEL``: control the verbosity of logging output. Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``. Defaults to: ``WARNING``.
43
+ * ``LOG_QUERIES``: enable (query) logging at the database backend level. Note that you must also set ``DEBUG=1``, which should be done very sparingly!. Defaults to: ``False``.
44
+ * ``LOG_REQUESTS``: enable logging of the outgoing requests. Defaults to: ``False``.
45
+ * ``LOG_OUTGOING_REQUESTS_EMIT_BODY``: Whether or not outgoing request bodies should be logged. Defaults to: ``True``.
46
+ * ``LOG_OUTGOING_REQUESTS_DB_SAVE``: Whether or not outgoing request logs should be saved to the database. Defaults to: ``False``.
47
+ * ``LOG_OUTGOING_REQUESTS_DB_SAVE_BODY``: Whether or not outgoing request bodies should be saved to the database. Defaults to: ``True``.
48
+ * ``LOG_OUTGOING_REQUESTS_MAX_AGE``: The amount of time after which request logs should be deleted from the database. Defaults to: ``7``.
45
49
 
46
50
 
47
51
  Celery
48
52
  ------
49
53
 
54
+ * ``CELERY_LOGLEVEL``: control the verbosity of logging output for celery, independent of ``LOG_LEVEL``. Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``. Defaults to: ``INFO``.
50
55
  * ``CELERY_RESULT_BACKEND``: the URL of the backend/broker that will be used by Celery to send the notifications. Defaults to: ``redis://localhost:6379/1``.
51
56
 
52
57
 
58
+ Cross-Origin-Resource-Sharing
59
+ -----------------------------
60
+
61
+ * ``CORS_ALLOW_ALL_ORIGINS``: allow cross-domain access from any client. Defaults to: ``False``.
62
+ * ``CORS_ALLOWED_ORIGINS``: explicitly list the allowed origins for cross-domain requests. Example: http://localhost:3000,https://some-app.gemeente.nl. Defaults to: ``[]``.
63
+ * ``CORS_ALLOWED_ORIGIN_REGEXES``: same as ``CORS_ALLOWED_ORIGINS``, but supports regular expressions. Defaults to: ``[]``.
64
+ * ``CORS_EXTRA_ALLOW_HEADERS``: headers that are allowed to be sent as part of the cross-domain request. By default, Authorization, Accept-Crs and Content-Crs are already included. The value of this variable is added to these already included headers. Defaults to: ``[]``.
65
+
66
+
53
67
  Elastic APM
54
68
  -----------
55
69
 
@@ -74,6 +88,7 @@ Content Security Policy
74
88
  Optional
75
89
  --------
76
90
 
91
+ * ``SITE_ID``: The database ID of the site object. You usually won't have to touch this. Defaults to: ``1``.
77
92
  * ``DEBUG``: Only set this to ``True`` on a local development environment. Various other security settings are derived from this setting!. Defaults to: ``False``.
78
93
  * ``USE_X_FORWARDED_HOST``: whether to grab the domain/host from the X-Forwarded-Host header or not. This header is typically set by reverse proxies (such as nginx, traefik, Apache...). Note: this is a header that can be spoofed and you need to ensure you control it before enabling this. Defaults to: ``False``.
79
94
  * ``IS_HTTPS``: Used to construct absolute URLs and controls a variety of security settings. Defaults to the inverse of ``DEBUG``.
@@ -82,11 +97,6 @@ Optional
82
97
  * ``EMAIL_HOST_PASSWORD``: password to connect to the mail server. Defaults to: ``(empty string)``.
83
98
  * ``EMAIL_USE_TLS``: whether to use TLS or not to connect to the mail server. Should be True if you're changing the ``EMAIL_PORT`` to 487. Defaults to: ``False``.
84
99
  * ``DEFAULT_FROM_EMAIL``: The default email address from which emails are sent. Defaults to: ``testapp@example.com``.
85
- * ``LOG_STDOUT``: whether to log to stdout or not. Defaults to: ``True``.
86
- * ``LOG_LEVEL``: control the verbosity of logging output. Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``. Defaults to: ``WARNING``.
87
- * ``LOG_QUERIES``: enable (query) logging at the database backend level. Note that you must also set ``DEBUG=1``, which should be done very sparingly!. Defaults to: ``False``.
88
- * ``LOG_REQUESTS``: enable logging of the outgoing requests. Defaults to: ``False``.
89
- * ``CELERY_LOGLEVEL``: control the verbosity of logging output for celery, independent of ``LOG_LEVEL``. Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``. Defaults to: ``INFO``.
90
100
  * ``SESSION_COOKIE_AGE``: For how long, in seconds, the session cookie will be valid. Defaults to: ``1209600``.
91
101
  * ``SESSION_COOKIE_SAMESITE``: The value of the SameSite flag on the session cookie. This flag prevents the cookie from being sent in cross-site requests thus preventing CSRF attacks and making some methods of stealing session cookie impossible.Currently interferes with OIDC. Keep the value set at Lax if used. Defaults to: ``Lax``.
92
102
  * ``CSRF_COOKIE_SAMESITE``: The value of the SameSite flag on the CSRF cookie. This flag prevents the cookie from being sent in cross-site requests. Defaults to: ``Strict``.
@@ -96,13 +106,9 @@ Optional
96
106
  * ``NUM_PROXIES``: the number of reverse proxies in front of the application, as an integer. This is used to determine the actual client IP adres. On Kubernetes with an ingress you typically want to set this to 2. Defaults to: ``1``.
97
107
  * ``CSRF_TRUSTED_ORIGINS``: A list of trusted origins for unsafe requests (e.g. POST). Defaults to: ``[]``.
98
108
  * ``NOTIFICATIONS_DISABLED``: indicates whether or not notifications should be sent to the Notificaties API for operations on the API endpoints. Defaults to ``True`` for the ``dev`` environment, otherwise defaults to ``False``.
99
- * ``SITE_DOMAIN``: Defines the primary domain where the application is hosted. Defaults to: ``example.com``.
109
+ * ``SITE_DOMAIN``: Defines the primary domain where the application is hosted. Defaults to: ``(empty string)``.
100
110
  * ``SENTRY_DSN``: URL of the sentry project to send error reports to. Default empty, i.e. -> no monitoring set up. Highly recommended to configure this.
101
111
  * ``DISABLE_2FA``: Whether or not two factor authentication should be disabled. Defaults to: ``False``.
102
- * ``LOG_OUTGOING_REQUESTS_EMIT_BODY``: Whether or not outgoing request bodies should be logged. Defaults to: ``True``.
103
- * ``LOG_OUTGOING_REQUESTS_DB_SAVE``: Whether or not outgoing request logs should be saved to the database. Defaults to: ``False``.
104
- * ``LOG_OUTGOING_REQUESTS_DB_SAVE_BODY``: Whether or not outgoing request bodies should be saved to the database. Defaults to: ``True``.
105
- * ``LOG_OUTGOING_REQUESTS_MAX_AGE``: The amount of time after which request logs should be deleted from the database. Defaults to: ``7``.
106
112
 
107
113
 
108
114
 
@@ -0,0 +1,26 @@
1
+ from django.conf import settings
2
+ from django.urls import reverse
3
+
4
+ import requests_mock
5
+ from django_webtest import WebTest
6
+
7
+
8
+ def test_sentry_settings():
9
+ """
10
+ test that sentry settings are initialized
11
+ """
12
+
13
+ assert hasattr(settings, "SENTRY_CONFIG") is True
14
+ assert hasattr(settings, "SENTRY_DSN") is True
15
+
16
+
17
+ @requests_mock.Mocker()
18
+ class RosettaTests(WebTest):
19
+ def test_rosetta_redirect_fails_with_lazy_login_url(self, m):
20
+ response = self.app.get("/admin/rosetta/files/project/")
21
+
22
+ expected_login_url = (
23
+ reverse(settings.LOGIN_URL) + "?next=/admin/rosetta/files/project/"
24
+ )
25
+ self.assertEqual(response.status_code, 302)
26
+ self.assertEqual(response.location, expected_login_url)
@@ -1,8 +0,0 @@
1
- def test_sentry_settings():
2
- """
3
- test that sentry settings are initialized
4
- """
5
- from django.conf import settings
6
-
7
- assert hasattr(settings, "SENTRY_CONFIG") is True
8
- assert hasattr(settings, "SENTRY_DSN") is True