testrecord serializer 增加draw_template字段

This commit is contained in:
caoqianming 2022-01-17 10:06:25 +08:00
parent 4257741c2d
commit b373262d40
4 changed files with 16 additions and 2 deletions

View File

@ -3,7 +3,7 @@ from django.contrib.auth.models import AbstractUser
from django.db.models.base import Model
import django.utils.timezone as timezone
from django.db.models.query import QuerySet
from apps.system.models import CommonAModel, CommonBModel, Organization, User, Dict, File,Position
from apps.system.models import CommonADModel, CommonAModel, CommonBModel, Organization, User, Dict, File,Position
from utils.model import SoftModel, BaseModel
from simple_history.models import HistoricalRecords
@ -36,3 +36,8 @@ class Employee(CommonAModel):
def __str__(self):
return self.name
class Attendance(CommonADModel):
"""
出勤记录
"""

View File

@ -1,3 +1,10 @@
from django.urls import reverse
from django.test import TestCase
from rest_framework.test import APITestCase
from rest_framework import status
# Create your tests here.
class WareHouseTests(APITestCase):
def test_list_warehouse(self):
url = reverse('warehouse-list')
resp = self.client.get(url)
self.assertEqual(resp.status_code, status.HTTP_200_OK)

View File

@ -59,6 +59,7 @@ class TestRecordItemSerializer(serializers.ModelSerializer):
parent = serializers.PrimaryKeyRelatedField(source='form_field.parent', read_only=True)
help_text = serializers.CharField(source='form_field.help_text', read_only=True)
sort = serializers.IntegerField(source='form_field.sort', read_only=True)
draw_template = serializers.CharField(source='form_field.draw_template', read_only=True)
class Meta:
model = TestRecordItem
fields = '__all__'

View File

@ -173,6 +173,7 @@ REST_FRAMEWORK = {
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema',
'UNAUTHENTICATED_USER': None,
'UNAUTHENTICATED_TOKEN': None,
'TEST_REQUEST_DEFAULT_FORMAT': 'json'
}
# simplejwt配置
SIMPLE_JWT = {