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
refactored test_resources.py into test_resources package #1672
refactored test_resources.py into test_resources package #1672
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this.
When I run make test
in release-4
I get 475 tests run.
In this branch, I get 306, so some tests are being missed. This is probably because some of the new modules with tests in are not named 'test_*'. If you rename these modules it should work.
Feel free to update the changelog, and also add your name to AUTHORS if you like
There is also a test failure due to a deprecation added to django. If you merge |
I have implemented the recommended changes from the review. The resources have been successfully extracted and restructured into tests. I've verified that the total number of tests remains consistent at 475, and all tests exhibit the same pass rate as before the refactor. |
Thanks. Am seeing one test failure in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great. Thank you Vedang, much appreciated. Will merge.
e87a8df
into
django-import-export:release-4
Hi Matthew, Thank you for your guidance! |
Sure - no problem - I'll email you. |
Problem
What problem have you solved?
The test_resources.py file had become large and cluttered with numerous classes, making it difficult to navigate, maintain, and understand the scope of individual tests. This complexity could potentially hinder future development and decrease overall code quality.
Solution
To address the issue, I refactored the test_resources.py file by organizing its contents into a more structured package named test_resources. This involved logically grouping related classes into separate module files within the package.
How did you solve the problem?
This involved logically grouping related classes into separate module files within the package.
The new structure is as follows:
basic_resources.py
: Contains foundational resource classes.enhanced_resources.py
: Contains resource classes with enhanced features.widgets.py
: Hosts widget-related classes.widget_tests.py
: Contains tests specifically for widgets.... [and so on for other modules]
Acceptance Criteria
Have you written tests? Have you included screenshots of your changes if applicable?
Did you document your changes?
No new tests were written as this was a refactoring task. But i made sure to run the make test command and check if all the test are passing