1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#!/usr/bin/env python -tt
# encoding: utf-8
#
from django.test import TestCase as DjangoTest, Client
from django.urls import reverse
from django.contrib.auth.models import User
from wlscreens.models import *
import os
#############
# TestCases #
#############
###########
# Uploads #
###########
class TestWLScreens_IndexSite_ExceptCorrectResult(DjangoTest):
def runTest(self):
url = reverse('wlscreens_index')
k = self.client.get(url)
self.assertTemplateUsed(k, 'wlscreens/index.html')
self.assertTrue(k.context['categories'] is not None)
# TODO(sirver): figure out how to make templates simpler for tests so that this
# simple test does not depend on the whole stack.
# class TestWLScreens_CategorySite_Except404(DjangoTest):
# urls = "wlscreens.test_urls"
# def setUp(self):
# c = Category.objects.create(name="A new Revision")
# def runTest(self):
# url = reverse('wlscreens_category', None, {"category_slug": "a-new-revision"})
# c = self.client.get(url)
# self.assertEqual(c.status_code, 404 )
|