コード例 #1
0
 def test_explicit_name(self):
     Alphabet.objects.bulk_create([Alphabet(a=123), Alphabet(a=456)])
     out = Alphabet.objects.all().aggregate(aaa=BitXor('a'))
     assert out == {'aaa': 435}
コード例 #2
0
 def test_implicit_name(self):
     Alphabet.objects.bulk_create([Alphabet(a=11), Alphabet(a=3)])
     out = Alphabet.objects.all().aggregate(BitXor('a'))
     assert out == {'a__bitxor': 8}
コード例 #3
0
 def test_explicit_name(self):
     Alphabet.objects.bulk_create([Alphabet(a=29), Alphabet(a=15)])
     out = Alphabet.objects.all().aggregate(aaa=BitOr('a'))
     assert out == {'aaa': 31}
コード例 #4
0
 def test_implicit_name(self):
     Alphabet.objects.bulk_create([Alphabet(a=29), Alphabet(a=15)])
     out = Alphabet.objects.all().aggregate(BitAnd('a'))
     assert out == {'a__bitand': 13}
コード例 #5
0
 def test_implicit_name(self):
     Alphabet.objects.bulk_create([Alphabet(a=1), Alphabet(a=84)])
     out = Alphabet.objects.all().aggregate(BitOr("a"))
     assert out == {"a__bitor": 85}
コード例 #6
0
 def test_explicit_name(self):
     Alphabet.objects.bulk_create([Alphabet(a=11), Alphabet(a=24)])
     out = Alphabet.objects.all().aggregate(aaa=BitAnd("a"))
     assert out == {"aaa": 8}