2014-05-09 13:17:19 +02:00
|
|
|
from django.test.client import Client
|
|
|
|
|
|
|
|
from openslides.assignment.models import Assignment
|
2014-10-11 14:34:49 +02:00
|
|
|
from openslides.users.models import User
|
2014-05-09 13:17:19 +02:00
|
|
|
from openslides.utils.test import TestCase
|
|
|
|
|
|
|
|
|
|
|
|
class AssignmentPDFTest(TestCase):
|
|
|
|
"""
|
|
|
|
Tests for assignment PDF.
|
|
|
|
"""
|
|
|
|
def setUp(self):
|
|
|
|
# Admin
|
|
|
|
self.admin = User.objects.get(pk=1)
|
|
|
|
self.admin_client = Client()
|
|
|
|
self.admin_client.login(username='admin', password='admin')
|
|
|
|
|
|
|
|
def test_render_pdf(self):
|
2015-01-25 15:10:34 +01:00
|
|
|
Assignment.objects.create(title='assignment_name_ith8qua1Eiferoqu5ju2', description="test", open_posts=1)
|
2014-05-09 13:17:19 +02:00
|
|
|
response = self.admin_client.get('/assignment/print/')
|
|
|
|
self.assertEqual(response.status_code, 200)
|
2014-10-10 19:01:34 +02:00
|
|
|
|
|
|
|
def test_render_many_posts(self):
|
2015-01-25 15:10:34 +01:00
|
|
|
Assignment.objects.create(title='assignment_name_cohZ9shaipee3Phaing4', description="test", open_posts=20)
|
2014-10-10 19:01:34 +02:00
|
|
|
response = self.admin_client.get('/assignment/print/')
|
|
|
|
self.assertEqual(response.status_code, 200)
|