def test_combine_auto_parse(self): instance = TestModel.objects.create(hll_field=HllEmpty() | 2 | 3) self.assertEqual( 2, TestModel.objects.annotate(card=Cardinality('hll_field')).filter( pk=instance.pk).values_list('card', flat=True)[0]) instance = TestModel.objects.create(hll_field=HllEmpty() | {2, 3}) self.assertEqual( 2, TestModel.objects.annotate(card=Cardinality('hll_field')).filter( pk=instance.pk).values_list('card', flat=True)[0])
def setUp(self): self.cursor = connection.cursor() TestModel.objects.bulk_create([ TestModel(id=100501, hll_field=HllEmpty()), TestModel(id=100502, hll_field=HllInteger(1)), TestModel(id=100503, hll_field=HllInteger(2)) ])
def test_create_custom_params(self): TestConfiguredModel.objects.create(hll_field=HllEmpty(13, 2, 1, 0))
def test_create(self): TestModel.objects.create(hll_field=HllEmpty())
def setUp(self): TestModel.objects.create(id=100501, hll_field=HllEmpty()),
def test_combine(self): TestModel.objects.create(hll_field=HllEmpty() | HllInteger(1) | HllInteger(2))
def setUp(self): self.default = TestModel.objects.create(id=100501, hll_field=HllEmpty()) self.non_default = TestConfiguredModel.objects.create( id=100502, hll_field=HllEmpty(13, 2, 1, 0))
def setUp(self): TestModel.objects.bulk_create([ TestModel(id=100501, hll_field=HllEmpty()), TestModel(id=100502, hll_field=HllInteger(1) | HllInteger(2)), TestModel(id=100503, hll_field=HllInteger(2)) ])