add fixtures in testcases

pull/1/head
eric 2016-04-09 13:21:12 -04:00
parent a4e9855b35
commit bca17837a0
5 changed files with 16 additions and 4 deletions

View File

@ -21,6 +21,7 @@ from regluit.utils.localdatetime import now
from regluit.api import models as apimodels
class ApiTests(TestCase):
fixtures = ['initial_data.json']
work_id=None
def setUp(self):
@ -135,6 +136,13 @@ class ApiTests(TestCase):
})
j = json.loads(r.content)
self.assertEqual(j['objects'][0]['filetype'], 'epub')
r = self.client.get('/api/v1/free/', data={
'format': 'xml',
'isbn': '0441007465',
'username': self.user.username,
'api_key': self.user.api_key.key
})
self.assertTrue(r.content.find('<rights>CC BY</rights>')>0)
def test_widget(self):
r = self.client.get('/api/widget/0441007465/')

View File

@ -480,7 +480,7 @@ class SearchTests(TestCase):
class CampaignTests(TestCase):
fixtures = ['initial_data.json']
def test_b2u(self):
w = Work()
w.save()
@ -810,6 +810,7 @@ class WorkTests(TestCase):
class DownloadPageTest(TestCase):
fixtures = ['initial_data.json']
def test_download_page(self):
w = models.Work()
w.save()
@ -897,7 +898,7 @@ class MailingListTests(TestCase):
@override_settings(LOCAL_TEST=True)
class EbookFileTests(TestCase):
fixtures = ['initial_data.json']
def test_badepub_errors(self):
textfile = NamedTemporaryFile(delete=False)
textfile.write("bad text file")
@ -1036,7 +1037,7 @@ class MobigenTests(TestCase):
from .signals import handle_transaction_charged
@override_settings(LOCAL_TEST=True)
class LibTests(TestCase):
fixtures = ['initial_data.json']
class transaction:
pass

View File

@ -211,7 +211,8 @@ class PledgingUiTests(TestCase):
pass
class UnifiedCampaignTests(TestCase):
fixtures=['basic_campaign_test.json']
fixtures=['initial_data.json','basic_campaign_test.json']
def test_setup(self):
# testing basics: are there 3 users?

View File

@ -4,6 +4,7 @@ from django.test import TestCase
from django.contrib.auth.models import User
class TestLibraryAuth(TestCase):
fixtures=['initial_data.json']
def setUp(self):
pass

View File

@ -275,6 +275,7 @@ class ExtraTest(TestCase):
class TransactionTest(TestCase):
fixtures=['initial_data.json']
def setUp(self):
"""
"""