Пример #1
0
    def test_round_places(self):
        Alphabet.objects.create(a=81731)

        with self.assertWarnsMessage(DeprecationWarning,
                                     "This function is deprecated."):
            around = Round("a", -2)
        ab = Alphabet.objects.annotate(around=around).get()

        assert ab.around == 81700
Пример #2
0
    def test_round_up(self):
        Alphabet.objects.create(g=27.859)

        with self.assertWarnsMessage(DeprecationWarning,
                                     "This function is deprecated."):
            ground = Round("g")
        ab = Alphabet.objects.annotate(ground=ground).get()

        assert ab.ground == 28
Пример #3
0
 def test_round_places(self):
     Alphabet.objects.create(a=81731)
     ab = Alphabet.objects.annotate(around=Round('a', -2)).get()
     assert ab.around == 81700
Пример #4
0
 def test_round_up(self):
     Alphabet.objects.create(g=27.859)
     ab = Alphabet.objects.annotate(ground=Round('g')).get()
     assert ab.ground == 28
Пример #5
0
 def test_round(self):
     Alphabet.objects.create(g=24.459)
     ab = Alphabet.objects.annotate(ground=Round("g")).get()
     assert ab.ground == 24