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')
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")
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
def test_single_arg_doesnt_work(self): with pytest.raises(ValueError): CRC32('name')