示例#1
0
 def test_over_18_is_adult(self):
     """Make sure someone over 18 is considered an adult."""
     rule = MustBeAdultRule(self.session)
     self.assertTrue(rule.match())
示例#2
0
 def test_under_18_is_rejected(self):
     """Make sure someone under 18 is NOT considered an adult."""
     self.session.customer.age = 13
     rule = MustBeAdultRule(self.session)
     self.assertFalse(rule.match())
示例#3
0
 def test_exactly_18_is_adult(self):
     """Make sure someone exactly 18 is considered an adult."""
     self.session.customer.age = 18
     rule = MustBeAdultRule(self.session)
     self.assertTrue(rule.match())