-
Notifications
You must be signed in to change notification settings - Fork 9
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
Integration Tests For Campaign #910
Merged
Merged
Conversation
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 commit adds role-based checks to ensure that only administrators or authorized users can perform certain actions in the campaign management module. These actions include creating and updating a campaign, managing campaign managers, and handling campaign technologies, communities, and testimonials. Unauthorized attempts are now handled by displaying a "Not authorized" error message. Some code clean-up and consistency improvements were made as well.
This commit introduces a substantial amount of tests for various Campaign-related API operations. This includes operations like creating, updating, and deleting campaigns, managing campaign managers and communities, handling campaign technologies, and associated testimonials and comments. All the tests take into account different user roles such as super admin, community admin, or an ordinary user.
…o campaign-tests
The changes include correcting the DJANGO_ENV variable setting in the 'start' rule of the Makefile for proper local deployment. The 'create-default-template' command has been removed, as it appears to be unnecessary.
The redundant local environment check was removed from settings.py. This simplification eliminates a conditional expression and makes the code cleaner and easier to maintain.
Cleaned up and refactored parts of the campaign-related code, particularly in 'campaign.py'. Ensured the removal of unused endpoints and validators. Also added the '@admins_only' decorator to some functions to restrict access. Updated the corresponding test suite to match these changes.
These two files in the API services and API store directories were removed as they were not being used. This aims to keep the codebase clean and manageable. Regular audits should be conducted to eliminate unused codes.
Added a function to create a new Vendor in the common.py file for testing. Modified the technology handlers to restrict modifications and deletions to admins and the respective owners only, improving security and accountability. This includes tweaks in the create, update and delete operations in the TechnologyStore. Adjustments have also been made to ensure the webpage details are properly updated when changing vendor information.
This commit introduces CampaignService which handles various campaign-related operations. It provides methods for creating, deleting, updating campaigns as well as managing campaign managers and communities. The service also includes tasks associated with campaign technology like adding a follower or technology view.
archx3
approved these changes
Feb 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary / Highlights
This pull request includes the following changes:
Update the build version to 5.1.13 in the deployConfig.json, build.json, and api_version_dev.txt files to ensure version consistency across all files.
Implement role-based authorization for campaign management to restrict certain actions to authorized users only.
Add comprehensive tests for Campaign API endpoints to ensure proper functionality and prevent regressions.
Details (Give details about what this PR accomplishes, include any screenshots etc)
Testing Steps (Provide details on how your changes can be tested)
Requirements (place an
x
in each[ ]
)Transparency (Project board)