diff --git a/commentaries/test_forms.py b/commentaries/test_forms.py new file mode 100644 index 0000000000000000000000000000000000000000..2e9cb5f6ba351402af656aec1be5d9ac257bc5c0 --- /dev/null +++ b/commentaries/test_forms.py @@ -0,0 +1 @@ +from django.test import TestCase diff --git a/commentaries/test_models.py b/commentaries/test_models.py new file mode 100644 index 0000000000000000000000000000000000000000..2e9cb5f6ba351402af656aec1be5d9ac257bc5c0 --- /dev/null +++ b/commentaries/test_models.py @@ -0,0 +1 @@ +from django.test import TestCase diff --git a/commentaries/test_views.py b/commentaries/test_views.py new file mode 100644 index 0000000000000000000000000000000000000000..2f1a36da23d32e8717347c715c3d49929831a7ab --- /dev/null +++ b/commentaries/test_views.py @@ -0,0 +1,27 @@ +from django.contrib.auth.models import Group +from django.core.urlresolvers import reverse +from django.core.management import call_command +from django.test import Client, TestCase + +# from .views import request_commentary + +class RequestCommentaryTest(TestCase): + """Test cases for request_commentary view method""" + # fixtures = ['permissions', 'groups', 'contributors'] + + def setUp(self): + self.client = Client() + self.client.login(username="feynman", password="richard") + self.url = reverse('commentaries:request_commentary') + + def test_get_request(self): + # contributor_group = Group.objects.get_or_create(name='Registered Contributors') + # self.contributor_group + request = self.client.get(self.url) + + self.user.user_permissions.add('scipost.can_request_commentary_pages') + + # Request succesfull + self.assertEquals( + request.status_code, 200, + 'Get request on request_commentary has failed')