-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update info if new django CMS version is available (#474)
* fix: use pypi api to check for latest version * Update tests
- Loading branch information
Showing
15 changed files
with
118 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM djangocms-admin-style-test:base | ||
|
||
RUN pip install -r /app/tests/requirements/django-3.2.txt | ||
|
||
ENV SCREENSHOT_REFERENCES="./tests/screenshots/reference-3.2" | ||
|
||
COPY . /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
djangocms_admin_style/static/djangocms_admin_style/js/dist/bundle.adminstyle.min.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-r base.txt | ||
Django>=3.2,<4 | ||
django-cms>=3.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-r base.txt | ||
Django>=4.1,<4.2 | ||
django-cms>=3.11.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from django.test import TestCase | ||
from django.test.client import RequestFactory | ||
|
||
import cms | ||
|
||
|
||
class Object: | ||
pass | ||
|
||
|
||
class TemplateTagsTestCase(TestCase): | ||
def setUp(self) -> None: | ||
self.request_factory = RequestFactory() | ||
|
||
def test_current_site_name(self): | ||
from djangocms_admin_style.templatetags.admin_style_tags import ( | ||
current_site_name, | ||
) | ||
site_name = current_site_name(dict()) | ||
self.assertEqual(site_name, "example.com") # Default name | ||
|
||
with self.modify_settings(INSTALLED_APPS={ | ||
'remove': [ | ||
'django.contrib.sites', | ||
], | ||
}): | ||
site_name = current_site_name(dict()) | ||
self.assertEqual(site_name, "my site") # Generic name | ||
|
||
def test_render_update_notification(self): | ||
from djangocms_admin_style.templatetags.admin_style_tags import ( | ||
render_update_notification, | ||
) | ||
self.assertEqual(render_update_notification(dict()), "") # No update notification | ||
|
||
request = self.request_factory.get("/") | ||
request.resolver_match = Object() | ||
request.resolver_match.url_name = "index" | ||
self.assertIn(f'<meta name="djangocms_version" content="{cms.__version__}">', | ||
render_update_notification(dict(request=request))) |