Refactor test files to use pytest fixtures for improved maintainability#2
Draft
Copilot wants to merge 152 commits into
Draft
Refactor test files to use pytest fixtures for improved maintainability#2Copilot wants to merge 152 commits into
Copilot wants to merge 152 commits into
Conversation
Co-authored-by: crcrewso <6089951+crcrewso@users.noreply.github.com>
Co-authored-by: crcrewso <6089951+crcrewso@users.noreply.github.com>
Co-authored-by: crcrewso <6089951+crcrewso@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor tests with multiple asserts to use pytest fixtures
Refactor test files to use pytest fixtures for improved maintainability
May 25, 2025
Fixes `BaseReport.make_url(...)` to handle the case where both domain ends with "/" and url ends with "/". Previous to this fix, links could be generated with "//" in them, rendering them unusable.
Resolves issue qatrackplus#568
Some selenium tests not working admin page is a mess
Updated to re_path, prep for django 4+ default_app_configuration no longer needed default_app_config no longer needed 2 default auto field change for db models internalizing admin_views for maintanability internalize form_utils missed updates missed find_elements function change in prev commit
…inheritance, add proper URL patterns, add permission checks, create template, and add tests
…precated django-admin-views package which has been replaced with class-based views. Tests are kept commented for reference during migration.
…er handling, Selenium WebDriver
…elForm implementation
…re src/ enables py.test
…ntation support context"
…cated stage names (commit, push) which will be removed in a future version. Hint: often `pre-commit autoupdate --repo https://github.com/pre-commit/pre-commit-hooks` will fix this. if it does not -- consider reporting an issue to that repo.
Fixed regression in views: Admin -> QC -> Statuses (admin/qa/testinstancestatus/) Admin -> Service Log -> Service Event Statuses (admin/service_log/serviceeventstatus/)
Owner
|
This was great work, but, could you rebase it off of the develop branch |
# Conflicts: # .gitignore # qatrack/qa/tests/test_tags.py # qatrack/reports/tests/test_qc.py
Author
Done — I've merged the |
| SECRET_KEY = secrets.token_urlsafe(64) | ||
| os.makedirs(os.path.dirname(SECRET_FILEPATH), exist_ok=True) | ||
| with open(SECRET_FILEPATH, 'w') as f: | ||
| f.write(SECRET_KEY) |
This file contains hidden or 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
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
This PR refactors several test files to use pytest fixtures instead of setUp methods and repetitive object creation. This improves test maintainability, readability, and reusability while preserving compatibility with Django's test runner.
Changes
Benefits
Example
Before:
After:
Related Files
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.