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

Improve code coverage #987

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mutombe
Copy link

@Mutombe Mutombe commented Oct 31, 2023

Summary

This pull request addresses issue #886 by introducing comprehensive tests for five views in the Projects app. These tests ensure the reliability and correctness of the views, enhancing the overall quality and stability of the application.

Changes

The following changes have been made in this pull request:

  1. Implemented tests for the ProjectCreateAPIView: These tests cover various scenarios related to project creation, validating inputs, handling permissions, and verifying the appropriate response codes and data.
  2. Implemented tests for the ProjectUpdateAPIView: These tests thoroughly examine the functionality of updating project details, including edge cases, error handling, and ensuring the proper behavior of the view under different circumstances.
  3. Implemented tests for the ProjectDeleteAPIView: These tests assess the behavior of the project deletion process, verifying that the appropriate permissions are enforced, confirming the correct response codes, and ensuring the database integrity is maintained.
  4. Implemented tests for the ProjectDetailsAPIView: These tests comprehensively evaluate the functionality of retrieving project details, covering different scenarios, handling various input cases, and validating the correctness of the returned data.

Each of these test implementations incorporates thorough test coverage to safeguard against regressions and ensure the robustness of the Projects app.

By introducing these tests, we can confidently assert the reliability and stability of these critical views, mitigating potential issues and providing a more professional and polished experience for our users.

Please review the changes and provide your feedback.

self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)


def test_create_project_unauthenticated_user(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be in ProjectCreateAPITest and not ProjectUpdateAPITest right?

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.

2 participants