From a7038b80c9bd7707e63872d21dc12e6b2a752c9b Mon Sep 17 00:00:00 2001 From: Steven Young Date: Tue, 5 May 2020 13:44:49 -0400 Subject: [PATCH] Fix tests --- news/tests.py | 5 ++--- pages/fixtures/pages.json | 32 ++++++++++++++++++++++++++++++++ staff/tests.py | 4 ++-- 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 pages/fixtures/pages.json diff --git a/news/tests.py b/news/tests.py index 3b5d982da..787871c44 100644 --- a/news/tests.py +++ b/news/tests.py @@ -2,15 +2,14 @@ from django.test import TestCase, RequestFactory from .views import * -from pages.models import StaticInfo class PostTestCase1(TestCase): + fixtures = ['pages.json'] + def setUp(self): self.factory = RequestFactory() self.user = User.objects.create_user(username='testuser', email='test@gmail.com', password='password') - static = StaticInfo() - static.save() # login = self.client.login(username='testuser', password='password') # post1 = Post.objects.create(title='Test Title', slug='Test_Slug', body='Testing Body Field') diff --git a/pages/fixtures/pages.json b/pages/fixtures/pages.json new file mode 100644 index 000000000..aa38aeeec --- /dev/null +++ b/pages/fixtures/pages.json @@ -0,0 +1,32 @@ +[ + { + "model": "pages.socialinfo", + "pk": 1, + "fields": { + "twitchchannel": null, + "youtubechannel": null, + "twitterprofile": "http://twitter.com/NFM_Studios", + "facebookpage": null, + "instagrampage": null, + "stream": null + } + }, + { + "model": "pages.staticinfo", + "pk": 1, + "fields": { + "featured_tournament": null, + "about_us": "about us", + "terms": "terms of service", + "block1text": null, + "block1link": null, + "block1_img": "", + "block2text": null, + "block2link": null, + "block2_img": "", + "block3text": null, + "block3link": null, + "block3_img": "" + } + } +] \ No newline at end of file diff --git a/staff/tests.py b/staff/tests.py index 8d7493612..ffd416976 100644 --- a/staff/tests.py +++ b/staff/tests.py @@ -4,6 +4,8 @@ class StaffBasicTest1(TestCase): + fixtures = ['pages.json'] + def setUp(self): self.factory = RequestFactory() self.user = User.objects.create_user(username='testuser', email='test@nfmstudios.com', password='password') @@ -196,5 +198,3 @@ def test_partner_list(self): response = users(request) self.assertEqual(response.status_code, 200) print('Completed staff:partner_list') - - print('Basic Staff tests have finished')