예제 #1
0
    def test_lti_consumer_models_inline_ratio_max(self):
        """The "inline_ratio" field should not accept values bigger than 10"""
        instance = LTIConsumerFactory(inline_ratio=10.01)

        with self.assertRaises(ValidationError) as context:
            instance.full_clean()

        self.assertEqual(
            str(context.exception),
            "{'inline_ratio': ['Ensure this value is less than or equal to 10.']}",
        )
예제 #2
0
    def test_lti_consumer_models_inline_ratio_min(self):
        """The "inline_ratio" field should not accept values smaller than 0.1"""
        instance = LTIConsumerFactory(inline_ratio=0.09)

        with self.assertRaises(ValidationError) as context:
            instance.full_clean()

        self.assertEqual(
            str(context.exception),
            "{'inline_ratio': ['Ensure this value is greater than or equal to 0.1.']}",
        )