示例#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)