1010
1111
1212import os
13- from collections import OrderedDict
1413from random import choices
15- from unittest .mock import MagicMock
1614from urllib .parse import quote
1715
1816from django .test import TestCase
1917from django .test .client import RequestFactory
20- from rest_framework .test import APIClient
21- from rest_framework .test import APIRequestFactory
2218
2319from vulnerabilities .api import PackageSerializer
2420from vulnerabilities .models import Package
2521
2622BASE_DIR = os .path .dirname (os .path .abspath (__file__ ))
27- TEST_DATA = os .path .join (BASE_DIR , "test_data/ " )
23+ TEST_DATA = os .path .join (BASE_DIR , "test_data" )
2824
2925
3026def cleaned_response (response ):
@@ -75,7 +71,7 @@ def cleaned_response(response):
7571
7672
7773class TestDebianResponse (TestCase ):
78- fixtures = [" debian.json" ]
74+ fixtures = [os . path . join ( TEST_DATA , "api_fixtures/ debian.json") ]
7975
8076 @classmethod
8177 def setUpTestData (cls ):
@@ -164,7 +160,7 @@ def test_query_by_package_url_without_namespace(self):
164160
165161
166162class APIResponseRelations (TestCase ):
167- fixtures = [" openssl.json" ]
163+ fixtures = [os . path . join ( TEST_DATA , "api_fixtures/ openssl.json") ]
168164
169165 def test_vulnerability_package_relations (self ):
170166
@@ -207,7 +203,7 @@ def test_vulnerability_package_relations(self):
207203
208204
209205class TestSerializers (TestCase ):
210- fixtures = [" debian.json" ]
206+ fixtures = [os . path . join ( TEST_DATA , "api_fixtures/ debian.json") ]
211207
212208 def test_package_serializer (self ):
213209 pk = Package .objects .filter (name = "mimetex" )
@@ -228,7 +224,7 @@ def test_package_serializer(self):
228224
229225
230226class TestBulkAPIResponse (TestCase ):
231- fixtures = [" github.json" ]
227+ fixtures = [os . path . join ( TEST_DATA , "api_fixtures/ github.json") ]
232228
233229 def test_bulk_packages_api (self ):
234230 request_body = {
0 commit comments