Test adding a custom-sized binary field on MySQL (#24846).
(self)
| 919 | |
| 920 | @unittest.skipUnless(connection.vendor == "mysql", "MySQL specific") |
| 921 | def test_add_binaryfield_mediumblob(self): |
| 922 | """ |
| 923 | Test adding a custom-sized binary field on MySQL (#24846). |
| 924 | """ |
| 925 | # Create the table |
| 926 | with connection.schema_editor() as editor: |
| 927 | editor.create_model(Author) |
| 928 | # Add the new field with default |
| 929 | new_field = MediumBlobField(blank=True, default=b"123") |
| 930 | new_field.set_attributes_from_name("bits") |
| 931 | with connection.schema_editor() as editor: |
| 932 | editor.add_field(Author, new_field) |
| 933 | columns = self.column_classes(Author) |
| 934 | # Introspection treats BLOBs as TextFields |
| 935 | self.assertEqual(columns["bits"][0], "TextField") |
| 936 | |
| 937 | @isolate_apps("schema") |
| 938 | @skipUnlessDBFeature("supports_json_field", "supports_stored_generated_columns") |
nothing calls this directly
no test coverage detected