1
0
mirror of https://github.com/django/django.git synced 2024-12-28 20:16:19 +00:00
django/tests/dbshell/test_sqlite.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
808 B
Python
Raw Normal View History

from pathlib import Path
from django.db.backends.sqlite3.client import DatabaseClient
from django.test import SimpleTestCase
class SqliteDbshellCommandTestCase(SimpleTestCase):
def settings_to_cmd_args_env(self, settings_dict, parameters=None):
if parameters is None:
parameters = []
return DatabaseClient.settings_to_cmd_args_env(settings_dict, parameters)
def test_path_name(self):
self.assertEqual(
self.settings_to_cmd_args_env({"NAME": Path("test.db.sqlite3")}),
(["sqlite3", Path("test.db.sqlite3")], None),
)
def test_parameters(self):
self.assertEqual(
self.settings_to_cmd_args_env({"NAME": "test.db.sqlite3"}, ["-help"]),
(["sqlite3", "test.db.sqlite3", "-help"], None),
)