Exemplo n.º 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}
Exemplo n.º 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}
Exemplo n.º 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}
Exemplo n.º 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}
Exemplo n.º 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}
Exemplo n.º 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}