示例#1
0
 def testPageButton(self):
     request = HttpRequest()
     response = page1_page(request)
     html = response.content.decode('utf8')
     self.assertIn(
         '<button type="submit" class="btn btn-primary" id="submit" onclick="storeChoice()">Store your choice!</button>',
         html, 'it broke')
示例#2
0
 def testPageLabel(self):
     request = HttpRequest()
     response = page1_page(request)
     html = response.content.decode('utf8')
     self.assertIn(
         '<label for="inputBox">There is a strange glass on the table, do you take it?</label>',
         html, 'it broke')
示例#3
0
 def testPage1NavContext4(self):
     request = HttpRequest()
     response = page1_page(request)
     html = response.content.decode('utf8')
     self.assertIn(
         '<a class="nav-link" href="page2.html" id="page2Anchor">Question 2</a>',
         html, 'it broke')
示例#4
0
 def testPage1NavContext1(self):
     request = HttpRequest()
     response = page1_page(request)
     html = response.content.decode('utf8')
     self.assertIn(
         '<nav class="navbar navbar-expand-lg navbar-dark bg-dark">', html,
         'it broke')
示例#5
0
 def testPageInput(self):
     request = HttpRequest()
     response = page1_page(request)
     html = response.content.decode('utf8')
     self.assertIn('<input type="text" id="inputBox">', html, 'it broke')
示例#6
0
 def testPageH1(self):
     request = HttpRequest()
     response = page1_page(request)
     html = response.content.decode('utf8')
     self.assertIn('<h1 id="banner"></h1>', html, 'it broke')
示例#7
0
 def testPage1Output(self):
     request = HttpRequest()
     response = page1_page(request)
     html = response.content.decode('utf8')
     self.assertIn('<h2 id="outputText"></h2>', html, 'it broke')
示例#8
0
 def testPage1Img(self):
     request = HttpRequest()
     response = page1_page(request)
     html = response.content.decode('utf8')
     self.assertIn('<img id="outputImg" alt="Image" title="Image">', html,
                   'it broke')