fix Booxtreem LOCAL_TEST

pull/91/head
eric 2018-06-08 15:01:22 -04:00
parent ab3c1934d5
commit 8b385d05ed
2 changed files with 6 additions and 4 deletions

View File

@ -64,9 +64,9 @@ class BooXtream(object):
boox = Boox.objects.create(
download_link_epub='https://github.com/eshellman/42_ebook/blob/master/download/42.epub?raw=true&extra=download.booxtream.com/',
download_link_mobi='https://github.com/eshellman/42_ebook/blob/master/download/42.mobi?raw=true',
referenceid= kwargs.get('referenceid'),
downloads_remaining= kwargs.get('downloadlimit'),
expirydays=kwargs.get('expirydays'),
referenceid= kwargs.get('referenceid', '42'),
downloads_remaining= kwargs.get('downloadlimit', 10),
expirydays=kwargs.get('expirydays', 30),
)
return boox

View File

@ -23,13 +23,15 @@ class TestBooXtream(unittest.TestCase):
return manager
def test_booxtream_errors(self):
if settings.LOCAL_TEST:
return
from .exceptions import BooXtreamError
inst = self._makeOne()
if not settings.BOOXTREAM_API_KEY:
return
with self.assertRaises(BooXtreamError) as cm:
inst.platform()
self.assertIn( 'expirydays not set',str(cm.exception))
self.assertIn('expirydays not set', str(cm.exception))
params={
'customername': 'Jane Test',
'languagecode':'1043',