mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Refs #23919 -- Removed str() conversion of type and method __name__.
This commit is contained in:
parent
41e0033caf
commit
9695b14982
17 changed files with 42 additions and 43 deletions
|
@ -1058,7 +1058,7 @@ class RelatedModelsTests(SimpleTestCase):
|
|||
'apps': self.apps,
|
||||
'proxy': proxy,
|
||||
}
|
||||
meta = type(str("Meta"), tuple(), meta_contents)
|
||||
meta = type("Meta", tuple(), meta_contents)
|
||||
if not bases:
|
||||
bases = (models.Model,)
|
||||
body = {
|
||||
|
|
|
@ -542,7 +542,7 @@ class WriterTests(SimpleTestCase):
|
|||
'verbose_name_plural': 'My models',
|
||||
}
|
||||
|
||||
migration = type(str("Migration"), (migrations.Migration,), {
|
||||
migration = type("Migration", (migrations.Migration,), {
|
||||
"operations": [
|
||||
migrations.CreateModel("MyModel", tuple(fields.items()), options, (models.Model,)),
|
||||
migrations.CreateModel("MyModel2", tuple(fields.items()), bases=(models.Model,)),
|
||||
|
@ -593,7 +593,7 @@ class WriterTests(SimpleTestCase):
|
|||
self.assertEqual(writer.path, expected_path)
|
||||
|
||||
def test_custom_operation(self):
|
||||
migration = type(str("Migration"), (migrations.Migration,), {
|
||||
migration = type("Migration", (migrations.Migration,), {
|
||||
"operations": [
|
||||
custom_migration_operations.operations.TestOperation(),
|
||||
custom_migration_operations.operations.CreateModel(),
|
||||
|
@ -615,7 +615,7 @@ class WriterTests(SimpleTestCase):
|
|||
"""
|
||||
#24155 - Tests ordering of imports.
|
||||
"""
|
||||
migration = type(str("Migration"), (migrations.Migration,), {
|
||||
migration = type("Migration", (migrations.Migration,), {
|
||||
"operations": [
|
||||
migrations.AddField("mymodel", "myfield", models.DateTimeField(
|
||||
default=datetime.datetime(2012, 1, 1, 1, 1, tzinfo=utc),
|
||||
|
@ -635,7 +635,7 @@ class WriterTests(SimpleTestCase):
|
|||
"""
|
||||
Test comments at top of file.
|
||||
"""
|
||||
migration = type(str("Migration"), (migrations.Migration,), {
|
||||
migration = type("Migration", (migrations.Migration,), {
|
||||
"operations": []
|
||||
})
|
||||
dt = datetime.datetime(2015, 7, 31, 4, 40, 0, 0, tzinfo=utc)
|
||||
|
@ -655,7 +655,7 @@ class WriterTests(SimpleTestCase):
|
|||
"""
|
||||
django.db.models shouldn't be imported if unused.
|
||||
"""
|
||||
migration = type(str("Migration"), (migrations.Migration,), {
|
||||
migration = type("Migration", (migrations.Migration,), {
|
||||
"operations": [
|
||||
migrations.AlterModelOptions(
|
||||
name='model',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue