-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: bump accounting mapping version #182
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe pull request involves an update to the Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
|
|
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.
def test_run_import_export_with_no_bc_creds(db): | ||
workspace_id = 10 | ||
response = run_import_export(workspace_id=workspace_id) | ||
|
||
assert response is None |
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.
🛠️ Refactor suggestion
Enhance test coverage and setup
The test appears overly simplistic compared to other test functions in this file. Consider the following improvements:
- Add proper workspace setup using the existing fixtures (create_temp_workspace)
- Document why None is the expected behavior when BC credentials are missing
- Verify that BusinessCentralCredentials are indeed not present
- Add assertions to confirm the workspace state remains unchanged
Here's a suggested implementation:
-def test_run_import_export_with_no_bc_creds(db):
- workspace_id = 10
- response = run_import_export(workspace_id=workspace_id)
-
- assert response is None
+def test_run_import_export_with_no_bc_creds(
+ db,
+ create_temp_workspace,
+ add_fyle_credentials,
+ create_export_settings
+):
+ """
+ Test run_import_export when Business Central credentials are missing.
+ Expected: Function should return None without processing any exports.
+ """
+ workspace_id = 1
+
+ # Verify BC credentials don't exist
+ assert not BusinessCentralCredentials.objects.filter(workspace_id=workspace_id).exists()
+
+ # Get initial state
+ initial_export_count = AccountingExport.objects.filter(workspace_id=workspace_id).count()
+
+ response = run_import_export(workspace_id=workspace_id)
+
+ # Verify response and no changes
+ assert response is None
+ assert AccountingExport.objects.filter(workspace_id=workspace_id).count() == initial_export_count
Committable suggestion skipped: line range outside the PR's diff.
|
|
* chore: bump accounting mapping version * Add testg * fix flaky test * fix flaky test
Description
Bump accounting mapping version
Clickup
https://app.clickup.com
Summary by CodeRabbit
fyle-accounting-mappings
package to 1.35.0.