Beispiel #1
0
    def test_floor(self):
        Alphabet.objects.create(g=1.5)

        with self.assertWarnsMessage(DeprecationWarning,
                                     "This function is deprecated."):
            gfloor = Floor("g")
        ab = Alphabet.objects.annotate(gfloor=gfloor).first()

        assert ab.gfloor == 1
Beispiel #2
0
 def test_floor(self):
     Alphabet.objects.create(g=1.5)
     ab = Alphabet.objects.annotate(gfloor=Floor('g')).first()
     assert ab.gfloor == 1