Skip to content

Commit

Permalink
chore: add improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
luisfelipec95 committed Feb 28, 2025
1 parent b619c7a commit d7dbe30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from django.test import TestCase
from eox_core.api.data.aggregated_collector.utils import execute_query


class UtilsTests(TestCase):
@patch("eox_core.api.data.aggregated_collector.utils.connection.cursor")
def test_execute_query_success(self, mock_cursor):
Expand All @@ -13,7 +14,7 @@ def test_execute_query_success(self, mock_cursor):
"""
mock_cursor.return_value.__enter__.return_value.fetchall.return_value = [(1, "test_user")]
mock_cursor.return_value.__enter__.return_value.description = [("id",), ("username",)]

result = execute_query("SELECT id, username FROM auth_user;")
expected_result = [{"id": 1, "username": "test_user"}]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from eox_core.api.data.aggregated_collector.tasks import generate_report
from eox_core.api.data.aggregated_collector.v1.views import AggregatedCollectorView


class AggregatedCollectorViewTests(TestCase):
def setUp(self):
self.client = APIClient()
Expand Down

0 comments on commit d7dbe30

Please sign in to comment.