Fix test issues
This commit is contained in:
@@ -16,7 +16,7 @@ from app.core.database import get_db
|
||||
from app.core.auth import get_current_user, AuthInfo
|
||||
from app.services.sales_service import SalesService
|
||||
from app.services.data_import_service import DataImportService
|
||||
from app.services.messaging import data_publisher
|
||||
from app.services.messaging import publish_sales_created
|
||||
from app.schemas.sales import (
|
||||
SalesDataCreate,
|
||||
SalesDataResponse,
|
||||
@@ -44,7 +44,7 @@ async def create_sales_record(
|
||||
|
||||
# Publish event (with error handling)
|
||||
try:
|
||||
await data_publisher.publish_sales_created({
|
||||
await publish_sales_created({
|
||||
"tenant_id": str(sales_data.tenant_id),
|
||||
"product_name": sales_data.product_name,
|
||||
"quantity_sold": sales_data.quantity_sold,
|
||||
@@ -149,7 +149,7 @@ async def import_sales_json(
|
||||
if result["success"]:
|
||||
# Publish event (with error handling)
|
||||
try:
|
||||
await data_publisher.publish_data_imported({
|
||||
await publish_data_imported({
|
||||
"tenant_id": str(import_data.tenant_id),
|
||||
"type": "json_import",
|
||||
"records_created": result["records_created"],
|
||||
|
||||
@@ -12,7 +12,7 @@ import structlog
|
||||
from app.core.database import get_db
|
||||
from app.core.auth import get_current_user, AuthInfo
|
||||
from app.services.weather_service import WeatherService
|
||||
from app.services.messaging import data_publisher
|
||||
from app.services.messaging import publish_weather_updated
|
||||
from app.schemas.external import (
|
||||
WeatherDataResponse,
|
||||
WeatherForecastResponse,
|
||||
@@ -71,7 +71,7 @@ async def get_weather_forecast(
|
||||
|
||||
# Publish event (with error handling)
|
||||
try:
|
||||
await data_publisher.publish_weather_updated({
|
||||
await publish_weather_updated({
|
||||
"type": "forecast_requested",
|
||||
"latitude": latitude,
|
||||
"longitude": longitude,
|
||||
@@ -118,7 +118,7 @@ async def get_historical_weather(
|
||||
|
||||
# Publish event (with error handling)
|
||||
try:
|
||||
await data_publisher.publish_weather_updated({
|
||||
await publish_weather_updated({
|
||||
"type": "historical_requested",
|
||||
"latitude": latitude,
|
||||
"longitude": longitude,
|
||||
|
||||
Reference in New Issue
Block a user