fix: error fixed about .authenticate() method and Evaluationrequest tests updated
This commit is contained in:
@@ -2,9 +2,9 @@ from typing import Any, Union
|
|||||||
|
|
||||||
REST_FRAMEWORK: Union[Any] = {
|
REST_FRAMEWORK: Union[Any] = {
|
||||||
"DEFAULT_AUTHENTICATION_CLASSES": (
|
"DEFAULT_AUTHENTICATION_CLASSES": (
|
||||||
"rest_framework.authentication.SessionAuthentication",
|
|
||||||
"rest_framework.authentication.BaseAuthentication",
|
|
||||||
"rest_framework_simplejwt.authentication.JWTAuthentication",
|
"rest_framework_simplejwt.authentication.JWTAuthentication",
|
||||||
|
"rest_framework.authentication.SessionAuthentication",
|
||||||
|
# "rest_framework.authentication.BaseAuthentication",
|
||||||
),
|
),
|
||||||
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
|
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
|
||||||
"DEFAULT_PERMISSION_CLASSES": ["rest_framework.permissions.IsAuthenticated"],
|
"DEFAULT_PERMISSION_CLASSES": ["rest_framework.permissions.IsAuthenticated"],
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ from core.apps.evaluation.choices.request import (
|
|||||||
RequestObjectType,
|
RequestObjectType,
|
||||||
RequestStatus,
|
RequestStatus,
|
||||||
)
|
)
|
||||||
|
from core.apps.evaluation.models import ReferenceitemModel
|
||||||
|
|
||||||
|
|
||||||
class EvaluationrequestModel(AbstractBaseModel):
|
class EvaluationrequestModel(AbstractBaseModel):
|
||||||
@@ -124,16 +125,19 @@ class EvaluationrequestModel(AbstractBaseModel):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def _baker(cls):
|
def _baker(cls):
|
||||||
user = baker.make(settings.AUTH_USER_MODEL)
|
user = baker.make(settings.AUTH_USER_MODEL)
|
||||||
|
reference = ReferenceitemModel.objects.create(
|
||||||
|
name="test"
|
||||||
|
)
|
||||||
return baker.make(
|
return baker.make(
|
||||||
cls,
|
cls,
|
||||||
user=user,
|
user=user,
|
||||||
rate_type=EvaluationRateType.AUTO,
|
rate_type=EvaluationRateType.AUTO,
|
||||||
customer_inn_number="123456789",
|
customer_inn_number="123456789",
|
||||||
owner_inn_number="987654321",
|
owner_inn_number="987654321",
|
||||||
value_determined="Bozor qiymati",
|
value_determined=reference,
|
||||||
rate_goal="Kredit uchun",
|
rate_goal=reference,
|
||||||
property_rights="Xususiy",
|
property_rights=reference,
|
||||||
form_ownership="Xususiy",
|
form_ownership=reference,
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
Reference in New Issue
Block a user