| 960 | @skipUnlessDBFeature("supports_virtual_generated_columns") |
| 961 | def test_add_generated_boolean_field(self): |
| 962 | class GeneratedBooleanFieldModel(Model): |
| 963 | value = IntegerField(null=True) |
| 964 | has_value = GeneratedField( |
| 965 | expression=Q(value__isnull=False), |
| 966 | output_field=BooleanField(), |
| 967 | db_persist=False, |
| 968 | ) |
| 969 | |
| 970 | class Meta: |
| 971 | app_label = "schema" |
| 972 | |
| 973 | with connection.schema_editor() as editor: |
| 974 | editor.create_model(GeneratedBooleanFieldModel) |
nothing calls this directly
no test coverage detected