Exemple #1
0
    def test_fail_with_additional_properties(self):
        def wrong_monkey():
            return Monkey(name="bonzo", collar="leather")

        def collar_monkey(monkey):
            monkey.collar = "leather"

        self.assertRaises(FamValidationError, wrong_monkey)
        monkey = Monkey(name="bonzo")
        self.assertRaises(FamValidationError, collar_monkey, monkey)
Exemple #2
0
 def test_update_works_without_rev(self):
     monkey = Monkey(name="fly")
     monkey.save(self.db)
     monkey.rev = None
     monkey.name = "jess"
     self.db.put(monkey)
Exemple #3
0
 def wrong_monkey():
     return Monkey(name="bonzo", collar="leather")
Exemple #4
0
 def test_update_works_without_rev(self):
     monkey = Monkey(name="fly")
     monkey.save(self.db)
     monkey.rev = None
     monkey.name = "jess"
     self.db.put(monkey)
Exemple #5
0
        def test_immutable_saving(self):

            monkey = Monkey(key="red_monkey", colour="red")
            self.db.put(monkey)
            monkey = Monkey(key="red_monkey", colour="blue")
            self.assertRaises(FamImmutableError, self.db.put, monkey)