Repository: joke2k/django-environ
Pull request #446 (2023-03-05 16:09:00)

Update SQL Server engine as mssql-django
As pointed in #295 , [mssql-django](https://pypi.org/project/mssql-django/) is an official django-mssql-backend port by Microsoft in the making. Besides, this package is also the only backend mentioned in django docuent for SQL Server ( https://docs.djangoproject.com/en/4.1/ref/databases/#using-a-3rd-party-database-backend ) .

Based on the document of `mssql-django`, the name of name should be `mssql`, so I changed it.

BTW, it's my regret to get known to `django-environ` so late, before which I was always struggling with a mess of varaibles in `.env` like "MYSQL_USER", "MYSQL_PASSWD", "DATABASE_ENGINE" to manage the different database between development and production environment. Thank you!

sergeyklay: @rcy17 Could you please update tests in `test_db_parsing`. It would also be nice to update the change log. Thank you!
rcy17: Sorry for ignoring the tests. 
I'v fixed the test and updated the change log. But I'm not sure the version number of this, and I just used 0.10.1.
coveralls: 
[![Coverage Status](https://coveralls.io/builds/57542384/badge)](https://coveralls.io/builds/57542384)

Coverage: 91.635%. Remained the same when pulling **79957a8160e1845a09aa3c342209b8f6b37584e0 on rcy17:patch-1** into **2191f5dfb233ac7e3ed6a58ad54266c358856462 on joke2k:develop**.


Patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 6b31049..ed60d06 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
 The format is inspired by `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_
 and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
 
+`v0.10.1`_ - 5-March-2023
+------------------------------
+Changed
++++++++
+- Used `mssql-django` as engine for SQL Server.
+  `#446 <https://github.com/joke2k/django-environ/pull/446>`_.
+
+
 `v0.10.0`_ - 2-March-2023
 -------------------------------
 Added
diff --git a/environ/environ.py b/environ/environ.py
index 9ca00a8..f4acdcf 100644
--- a/environ/environ.py
+++ b/environ/environ.py
@@ -121,7 +121,7 @@ class Env:
         'mysql2': 'django.db.backends.mysql',
         'mysql-connector': 'mysql.connector.django',
         'mysqlgis': 'django.contrib.gis.db.backends.mysql',
-        'mssql': 'sql_server.pyodbc',
+        'mssql': 'mssql',
         'oracle': 'django.db.backends.oracle',
         'pyodbc': 'sql_server.pyodbc',
         'redshift': 'django_redshift_backend',


Test patch:
diff --git a/tests/test_db.py b/tests/test_db.py
index c407413..fe50284 100644
--- a/tests/test_db.py
+++ b/tests/test_db.py
@@ -118,7 +118,7 @@ from environ.compat import DJANGO_POSTGRES
         # mysql://user:password@host/dbname
         ('mssql://enigma:secret@example.com/dbname'
          '?driver=ODBC Driver 13 for SQL Server',
-         'sql_server.pyodbc',
+         'mssql',
          'dbname',
          'example.com',
          'enigma',
@@ -127,7 +127,7 @@ from environ.compat import DJANGO_POSTGRES
         # mysql://user:password@host:port/dbname
         ('mssql://enigma:secret@amazonaws.com\\insnsnss:12345/dbname'
          '?driver=ODBC Driver 13 for SQL Server',
-         'sql_server.pyodbc',
+         'mssql',
          'dbname',
          'amazonaws.com\\insnsnss',
          'enigma',