From f98d6e9f208e108660cdaa9eff83d73df4ad5f30 Mon Sep 17 00:00:00 2001 From: Lyndon Garvey Date: Tue, 21 May 2024 11:30:24 +0100 Subject: [PATCH] Remove SQLlite --- app/views.py | 18 +----------------- demodjango/settings.py | 6 +----- tests/smoke/test_landing_page.py | 5 ----- 3 files changed, 2 insertions(+), 27 deletions(-) diff --git a/app/views.py b/app/views.py index aa2c278..48dacf6 100644 --- a/app/views.py +++ b/app/views.py @@ -28,7 +28,6 @@ REDIS = 'redis' S3 = 's3' SERVER_TIME = 'server_time' -SQLITE = 'sqlite3' HTTP_CONNECTION = 'http' ALL_CHECKS = { @@ -41,7 +40,6 @@ REDIS: 'Redis', S3: 'S3 Bucket', SERVER_TIME: 'Server Time', - SQLITE: 'SQLite3', HTTP_CONNECTION: 'HTTP Checks', } @@ -58,7 +56,7 @@ def index(request): "headers": dict(request.headers), }) - status_check_results = [server_time_check(), git_information(), sqlite_check()] + status_check_results = [server_time_check(), git_information()] optional_checks: Dict[str, Callable] = { POSTGRES_RDS: postgres_rds_check, @@ -117,20 +115,6 @@ def postgres_aurora_check(): return render_connection_info(addon_type, False, str(e)) -def sqlite_check(): - addon_type = ALL_CHECKS[SQLITE] - try: - db_name = "default" - if RDS_POSTGRES_CREDENTIALS: - db_name = "sqlite" - - with connections[db_name].cursor() as c: - c.execute('SELECT SQLITE_VERSION()') - return render_connection_info(addon_type, True, c.fetchone()[0]) - except Exception as e: - return render_connection_info(addon_type, False, str(e)) - - def redis_check(): addon_type = ALL_CHECKS[REDIS] try: diff --git a/demodjango/settings.py b/demodjango/settings.py index 390be5b..0a0e3f6 100644 --- a/demodjango/settings.py +++ b/demodjango/settings.py @@ -159,11 +159,7 @@ DATABASES = { "default": dj_database_url.config( default=database_url_from_env("RDS_POSTGRES_CREDENTIALS") - ), - "sqlite": { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': sqlite_db_root / "demodjango.sqlite3", - } + ) } else: DATABASES = { diff --git a/tests/smoke/test_landing_page.py b/tests/smoke/test_landing_page.py index e3f862e..b4af01a 100644 --- a/tests/smoke/test_landing_page.py +++ b/tests/smoke/test_landing_page.py @@ -14,7 +14,6 @@ REDIS, S3, SERVER_TIME, - SQLITE, HTTP_CONNECTION, ) @@ -32,10 +31,6 @@ def test_page_loads_with_title_and_has_success_ticks(page: Page): page.get_by_test_id(slugify(ALL_CHECKS[GIT_INFORMATION])) ).to_have_text(re.compile(STATUS_SUCCESS)) - expect( - page.get_by_test_id(slugify(ALL_CHECKS[SQLITE])) - ).to_have_text(re.compile(STATUS_SUCCESS)) - expect( page.get_by_test_id(slugify(ALL_CHECKS[POSTGRES_RDS])) ).to_have_text(re.compile(STATUS_SUCCESS))