Skip to content

Commit

Permalink
fix mock for test
Browse files Browse the repository at this point in the history
  • Loading branch information
larinam committed Aug 19, 2024
1 parent 490856a commit 64c4653
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/routers/test_users.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from unittest.mock import patch

import pytest
from bson.objectid import ObjectId
from fastapi.testclient import TestClient

from ..main import app

import pytest
from ..model import User, AuthDetails, Tenant
from bson.objectid import ObjectId

client = TestClient(app)

Expand Down Expand Up @@ -56,6 +55,7 @@ def test_read_users(mock_user, mock_tenant):

# Setup the mock for User.objects
mock_user_objects.return_value.all.return_value = [mock_user]
mock_user_objects.return_value.order_by.return_value.all.return_value = [mock_user]
mock_tenant_objects.return_value.first.return_value = mock_tenant

# Mock jwt.decode to return a valid payload
Expand Down

0 comments on commit 64c4653

Please sign in to comment.