Skip to content

test: add coverage for file upload view#452

Open
sarkarshrayan2-max wants to merge 1 commit into
DjangoCRM:mainfrom
sarkarshrayan2-max:test-file-upload-view
Open

test: add coverage for file upload view#452
sarkarshrayan2-max wants to merge 1 commit into
DjangoCRM:mainfrom
sarkarshrayan2-max:test-file-upload-view

Conversation

@sarkarshrayan2-max

Copy link
Copy Markdown

Closes #410

Summary

Added unit tests for the staff-only file_upload view.

The tests cover:

  • Rendering the upload form for staff users
  • Uploading a valid PNG image
  • Rejecting unsupported file extensions
  • Restricting access for non-staff users

Testing

  • python manage.py test tests.massmail.views.test_file_upload --keepdb
  • python manage.py test tests/ --noinput ⚠️ The full suite has pre-existing failures/errors that were present before this change.

Pull Request Checklist

  • Tests passed.
      python manage.py test tests/ --noinput
  • No testing required.
  • Make sure you are requesting to pull a topic/feature/bugfix branch. Don't request your master!
  • A descriptive title and description of the changes made are provided.
  • Submit one item per pull request. This eases reviewing and speeds up merging.
  • All changed files cannot be split into multiple pull requests (must be in one PR)
  • The documentation is up-to-date

When applicable

  • The issue number is provided in the description or title of the pull request.
  • Does this close the issue mentioned?
  • Screenshots of the results are provided.
  • Additional tests have been written.

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.

Create unit tests for the file_upload view

1 participant