Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
techlover1 committed May 5, 2020
1 parent 4207811 commit a7038b8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
5 changes: 2 additions & 3 deletions news/tests.py
Expand Up @@ -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')

Expand Down
32 changes: 32 additions & 0 deletions 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": ""
}
}
]
4 changes: 2 additions & 2 deletions staff/tests.py
Expand Up @@ -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')
Expand Down Expand Up @@ -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')

0 comments on commit a7038b8

Please sign in to comment.