Skip to content

Commit

Permalink
Provisional Django 2.2 LTS update rockstor#2625
Browse files Browse the repository at this point in the history
Update our Django dependency. It is generally recommended
to only update Django from one LTS to the next: 2.2 LTS
is our next-in-line.

## Includes
- A prior overlooked migration intended to prepare for this
Django update. See:GitHub rockstor#2666 rockstor#2667
- Replace deprecated multi_db with databases 'property':
"RemovedInDjango31Warning: TestCase.multi_db is deprecated."
Which ended up breaking one of our unit tests. And so was
included in this update.

N.B. there remains some Django update warnings but these are
to be addressed in future dedicated issues/commits.
  • Loading branch information
phillxnet committed Oct 10, 2023
1 parent 7e5ef5c commit de00cb4
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 16 deletions.
46 changes: 34 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ generate-setup-file = false
python = ">= 3.6, < 3.9"

# [tool.poetry.group.django.dependencies]
django = "==1.11.29"
django = "~2.2"
django-oauth-toolkit = "==1.1.2"
djangorestframework = "==3.9.3"
django-pipeline = "==1.7.0" # last version listed with Python 3.6 and Django 1.11 compatibility
Expand Down
2 changes: 1 addition & 1 deletion src/rockstor/smart_manager/tests/test_snmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@


class SNMPTests(APITestCase):
multi_db = True
databases = '__all__'
# TODO Requires command to reproduce minimal fixture:
# "services.json" fixture requires only the smart_manager.service model.
fixtures = ["test_api.json", "services.json"]
Expand Down
2 changes: 1 addition & 1 deletion src/rockstor/smart_manager/tests/test_task_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TaskSchedulerTests(APITestCase):
# src/rockstor/storageadmin/fixtures/test_pool_scrub_balance_minimal.json
#
# ./bin/test -v 2 -p test_task_scheduler.py
multi_db = True
databases = '__all__'
fixtures = ["scheduled_tasks.json"]
BASE_URL = "/api/sm/tasks"

Expand Down
17 changes: 17 additions & 0 deletions src/rockstor/storageadmin/migrations/0018_auto_20231009_1827.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 2.2.28 on 2023-10-09 17:27

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('storageadmin', '0017_auto_20230810_1141'),
]

operations = [
migrations.AlterModelOptions(
name='disk',
options={'base_manager_name': 'attached'},
),
]
1 change: 1 addition & 0 deletions src/rockstor/storageadmin/tests/test_appliances.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class AppliancesTests(APITestMixin):
fixtures = ["test_api.json", "test_appliances.json"]
BASE_URL = "/api/appliances"
client = APIClient()
databases = '__all__'

@classmethod
def setUpClass(cls):
Expand Down
2 changes: 1 addition & 1 deletion src/rockstor/storageadmin/tests/test_shares.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@


class ShareTests(APITestMixin):
multi_db = True
databases = '__all__'
fixtures = ["test_api.json", "test_shares.json", "test_shares-services.json"]
BASE_URL = "/api/shares"

Expand Down

0 comments on commit de00cb4

Please sign in to comment.