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)
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")
def test_visit_anonymous(self): s = MockSection() upv = UserPageVisitor(s, Anon()) upv.visit() self.assertEqual(s.needs_submit_called, 0)