Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Description of notification shown in a dialog box #272

Conversation

Dhanus3133
Copy link
Member

Fixes: #254

(Test fails for the new type)

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good progress @Dhanus3133, see my comments below.

The tests which are failing are for the sample app, an example extension of this module, see: https://github.com/openwisp/openwisp-notifications/blob/master/tests/openwisp2/settings.py#L199-L219.

openwisp_notifications/templates/admin/base_site.html Outdated Show resolved Hide resolved
openwisp_notifications/templates/admin/base_site.html Outdated Show resolved Hide resolved
@pandafy pandafy force-pushed the feat/display-description-notification-dialog branch from 2605a09 to db83e71 Compare May 14, 2024 17:50
@pandafy pandafy changed the base branch from master to fix-flaky-tests May 14, 2024 19:17
@nemesifier nemesifier marked this pull request as ready for review May 17, 2024 20:51
@pandafy pandafy force-pushed the feat/display-description-notification-dialog branch from 4a8f765 to 4d27aa9 Compare May 17, 2024 20:58
@nemesifier nemesifier deleted the branch openwisp:fix-flaky-tests May 17, 2024 21:14
@nemesifier nemesifier closed this May 17, 2024
@@ -533,7 +533,7 @@ def test_notification_setting_list_api(self):
self.assertEqual(len(response.data['results']), number_of_settings)

with self.subTest('Test "page_size" query'):
page_size = 1
page_size = 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test assumes that only one NotificationSetting to be present in the database which was correct when we only had the "default" notification type. We introduced another notification type, so there will be two NotificationSettings in the DB.

When we set the page_size to 1 in the request, the response would contain only one object per page. Since, there are two objects now in the DB, there will be two pages available for this page size. Thus, the next URL is not empty.

Read the DRF docs on pagination for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] Add dedicated notification type for internal errors
3 participants