Ejemplo n.º 1
0
    def test_crc32_only_takes_one_arg_no_kwargs(self):
        with pytest.raises(TypeError):
            CRC32('d', 'c')

        with pytest.raises(TypeError):
            CRC32('d', something='wrong')
Ejemplo n.º 2
0
    def test_crc32_only_takes_one_arg_no_kwargs(self):
        with pytest.raises(TypeError):
            CRC32("d", "c")

        with pytest.raises(TypeError):
            CRC32("d", something="wrong")
Ejemplo n.º 3
0
 def test_crc32(self):
     Alphabet.objects.create(d='AAAAAA')
     ab = Alphabet.objects.annotate(crc=CRC32('d')).first()
     # Precalculated this in MySQL prompt. Python's binascii.crc32 doesn't
     # match - maybe sign issues?
     assert ab.crc == 2854018686
Ejemplo n.º 4
0
 def test_single_arg_doesnt_work(self):
     with pytest.raises(ValueError):
         CRC32('name')