api: Drop test_post_code_feature_roi
This commit is contained in:
parent
8615aef2a8
commit
8c2c225425
@ -4,14 +4,8 @@ from django.test import Client
|
||||
from products.models import *
|
||||
from products.ip2region import ip_to_region
|
||||
from django.contrib.auth.models import User
|
||||
import subprocess
|
||||
import uuid
|
||||
import time
|
||||
import json
|
||||
import os
|
||||
import atexit
|
||||
from PIL import Image
|
||||
import io
|
||||
|
||||
BASE_DIR = os.path.abspath(os.path.dirname(__file__) + "/..")
|
||||
|
||||
@ -138,17 +132,6 @@ class APITest(TestCase):
|
||||
self.assertIn('error', r.json())
|
||||
self.assertIn('Inactive code', r.json()['error'])
|
||||
|
||||
def test_post_code_feature_roi(self):
|
||||
roi_file = os.path.join(BASE_DIR, 'tests/data/0074252612205-roi.jpg')
|
||||
img = Image.open(roi_file)
|
||||
width = img.width
|
||||
r = self.post("/api/v1/code-feature-roi/", admin=True,
|
||||
files={ "0074252612205.jpg": open(roi_file, 'rb') })
|
||||
self.assertEqual(r.status_code, 200)
|
||||
r = self.get("/api/v1/code-feature-roi/?code=0074252612205", admin=True)
|
||||
img = Image.open(io.BytesIO(r.content))
|
||||
self.assertEqual(img.width, width)
|
||||
|
||||
def test_estor_archive(self):
|
||||
fn = '/emblem/batches/2023-7-8-22-49-10文件夹 - emblem100/import/emblem100/1259109190683.jpg'
|
||||
body = b'abcdef'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user