1- import os
2-
31from django .contrib .auth .models import User
42from django .core .cache import cache
53from rest_framework .test import APITestCase
64from rest_framework .authtoken .models import Token
75
86from api .models import App , Certificate , Domain
7+ from api .tests import TEST_ROOT
98
109
1110class CertificateUseCase4Test (APITestCase ):
@@ -32,8 +31,6 @@ def setUp(self):
3231
3332 self .certificates = {}
3433
35- path = os .path .dirname (os .path .realpath (__file__ ))
36-
3734 # load up the certs
3835 for domain in self .domains :
3936 self .certificates [domain ] = {'name' : domain .replace ('.' , '-' ).replace ('*' , 'wildcard' )}
@@ -42,10 +39,10 @@ def setUp(self):
4239 # Cheap hack
4340 filename = domain .replace ('*' , 'www' )
4441
45- with open ('{}/certs/{}.key' .format (path , filename )) as f :
42+ with open ('{}/certs/{}.key' .format (TEST_ROOT , filename )) as f :
4643 self .certificates [domain ]['key' ] = f .read ()
4744
48- with open ('{}/certs/{}.cert' .format (path , filename )) as f :
45+ with open ('{}/certs/{}.cert' .format (TEST_ROOT , filename )) as f :
4946 self .certificates [domain ]['cert' ] = f .read ()
5047
5148 # add expires, common_name and fingerprints
0 commit comments