Skip to content

Commit

Permalink
feat!: upgrading django-storages to 1.13.2 (openedx#33301)
Browse files Browse the repository at this point in the history
* feat!: upgrading `django-storages` to `1.13.2`
  • Loading branch information
awais786 authored Sep 21, 2023
1 parent f81b64f commit 4943674
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 11 deletions.
22 changes: 17 additions & 5 deletions cms/djangoapps/contentstore/tests/test_video_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,15 @@ def setUp(self):
self.storage = S3Boto3Storage()
self.storage._connections.connection = MagicMock() # pylint: disable=protected-access

def order_dict(self, dictionary):
"""
sorting dict key:values for tests cases.
"""
sorted_key_values = sorted(dictionary.items())
dictionary.clear()
dictionary.update(sorted_key_values)
return dictionary

def test_video_backend(self):
self.assertEqual(
S3Boto3Storage,
Expand Down Expand Up @@ -416,9 +425,10 @@ def test_storage_without_global_default_acl_setting(self):
obj = storage.bucket.Object.return_value
obj.upload_fileobj.assert_called_with(
content,
ExtraArgs={
ExtraArgs=self.order_dict({
'ContentType': 'text/plain',
}
}),
Config=storage._transfer_config # pylint: disable=protected-access
)

@override_settings(AWS_DEFAULT_ACL='public-read')
Expand Down Expand Up @@ -452,7 +462,8 @@ def test_storage_without_global_default_acl_setting_and_bucket_acls(self, defaul

obj.upload_fileobj.assert_called_with(
content,
ExtraArgs=ExtraArgs
ExtraArgs=self.order_dict(ExtraArgs),
Config=storage._transfer_config # pylint: disable=protected-access
)

@ddt.data('public-read', 'private')
Expand All @@ -473,7 +484,8 @@ def test_storage_passing_default_acl_as_none(self, input_acl):
obj = storage.bucket.Object.return_value
obj.upload_fileobj.assert_called_with(
content,
ExtraArgs={
ExtraArgs=self.order_dict({
'ContentType': 'text/plain',
}
}),
Config=storage._transfer_config # pylint: disable=protected-access
)
1 change: 1 addition & 0 deletions lms/envs/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ def get_env_setting(setting):
else:
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'


# If there is a database called 'read_replica', you can use the use_read_replica_if_available
# function in util/query.py, which is useful for very large database reads
DATABASES = AUTH_TOKENS.get('DATABASES', DATABASES)
Expand Down
4 changes: 2 additions & 2 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ celery>=5.2.2,<6.0.0
click>=8.0,<9.0

# django-storages version upgrade
django-storages==1.12.3
django-storages==1.13.2


# The team that owns this package will manually bump this package rather than having it pulled in automatically.
Expand Down Expand Up @@ -131,6 +131,6 @@ openedx-events<8.6.0 # Open edX Events from Hooks Extension Framew
openedx-learning==0.1.6

# lti-consumer-xblock 9.6.2 contains a breaking change that makes
# existing custom parameter configurations unusable.
# existing custom parameter configurations unusable.
# https://github.com/openedx/xblock-lti-consumer/issues/410 has been opened to track a fix
lti-consumer-xblock==9.6.1
2 changes: 1 addition & 1 deletion requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ django-statici18n==2.4.0
# -r requirements/edx/kernel.in
# lti-consumer-xblock
# xblock-drag-and-drop-v2
django-storages==1.12.3
django-storages==1.13.2
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ django-statici18n==2.4.0
# -r requirements/edx/testing.txt
# lti-consumer-xblock
# xblock-drag-and-drop-v2
django-storages==1.12.3
django-storages==1.13.2
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/doc.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ django-statici18n==2.4.0
# -r requirements/edx/base.txt
# lti-consumer-xblock
# xblock-drag-and-drop-v2
django-storages==1.12.3
django-storages==1.13.2
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ django-statici18n==2.4.0
# -r requirements/edx/base.txt
# lti-consumer-xblock
# xblock-drag-and-drop-v2
django-storages==1.12.3
django-storages==1.13.2
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
Expand Down

0 comments on commit 4943674

Please sign in to comment.