

def test_return_type(self):
    b = BooleanModel.objects.create(bfield=True)
    b.refresh_from_db()
    self.assertEqual(b.bfield, True)
    b2 = BooleanModel.objects.create(bfield=False)
    b2.refresh_from_db()
    b.assertEqual(b2.bfield, False)
    b3 = NullBooleanModel.objects.create(nbfield=True)
    b3.refresh_from_db()
    self.assertEqual(b3.nbfield, True)
    b4 = NullBooleanModel.objects.create(nbfield=False)
    b4.refresh_from_db()
    self.assertEqual(b4.nbfield, False)
    b5 = BooleanModel.objects.all().extra(select={
        'string_col': 'string',
    })[0]
    self.assertNotIsInstance(b5.pk, bool)

dataset/ETHPy150Open django/django/tests/model_fields/test_booleanfield.py BooleanFieldTests.test_return_type/VarMisuse@59/72 `self`->`b`