コード例 #1
0
 def test_visit_status(self):
     s = MockSection()
     upv = UserPageVisitor(s, NonAnon())
     upv.visit(status=True)
     self.assertEqual(s.needs_submit_called, 0)
     self.assertEqual(s.user_pagevisit_called, 1)
     self.assertEqual(s.status, True)
コード例 #2
0
 def test_visit_not_status_needs_submit(self):
     s = MockSection(needs_submit_value=True)
     upv = UserPageVisitor(s, NonAnon())
     upv.visit(status=False)
     self.assertEqual(s.needs_submit_called, 1)
     self.assertEqual(s.user_pagevisit_called, 1)
     self.assertEqual(s.status, "incomplete")
コード例 #3
0
 def test_visit_status(self):
     s = MockSection()
     upv = UserPageVisitor(s, NonAnon())
     upv.visit(status=True)
     self.assertEqual(s.needs_submit_called, 0)
     self.assertEqual(s.user_pagevisit_called, 1)
     self.assertEqual(s.status, True)
コード例 #4
0
 def test_visit_not_status_needs_submit(self):
     s = MockSection(needs_submit_value=True)
     upv = UserPageVisitor(s, NonAnon())
     upv.visit(status=False)
     self.assertEqual(s.needs_submit_called, 1)
     self.assertEqual(s.user_pagevisit_called, 1)
     self.assertEqual(s.status, "incomplete")
コード例 #5
0
 def test_visit_anonymous(self):
     s = MockSection()
     upv = UserPageVisitor(s, Anon())
     upv.visit()
     self.assertEqual(s.needs_submit_called, 0)
コード例 #6
0
 def test_visit_anonymous(self):
     s = MockSection()
     upv = UserPageVisitor(s, Anon())
     upv.visit()
     self.assertEqual(s.needs_submit_called, 0)