core-framework 0.12.13__tar.gz → 0.12.14__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {core_framework-0.12.13 → core_framework-0.12.14}/PKG-INFO +1 -1
- {core_framework-0.12.13 → core_framework-0.12.14}/core/__init__.py +1 -1
- {core_framework-0.12.13 → core_framework-0.12.14}/core/migrations/engine.py +40 -1
- {core_framework-0.12.13 → core_framework-0.12.14}/core/migrations/operations.py +57 -6
- {core_framework-0.12.13 → core_framework-0.12.14}/pyproject.toml +1 -1
- {core_framework-0.12.13 → core_framework-0.12.14}/tests/test_issues_fixes.py +25 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/.gitignore +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/README.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/app.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/auth/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/auth/backends.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/auth/base.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/auth/decorators.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/auth/hashers.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/auth/helpers.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/auth/middleware.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/auth/models.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/auth/permissions.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/auth/schemas.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/auth/tokens.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/auth/views.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/choices.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/cli/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/cli/main.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/config.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/database.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/datetime.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/dependencies.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/deployment/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/deployment/docker.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/deployment/kubernetes.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/deployment/pm2.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/exceptions.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/fields.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/avro.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/base.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/config.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/confluent/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/confluent/consumer.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/confluent/producer.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/decorators.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/kafka/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/kafka/admin.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/kafka/broker.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/kafka/consumer.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/kafka/producer.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/rabbitmq/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/rabbitmq/broker.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/rabbitmq/consumer.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/rabbitmq/producer.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/redis/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/redis/broker.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/redis/consumer.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/redis/producer.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/registry.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/topics.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/messaging/workers.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/middleware.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/migrations/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/migrations/analyzer.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/migrations/cli.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/migrations/migration.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/migrations/state.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/models.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/permissions.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/querysets.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/relations.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/routing.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/serializers.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/tasks/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/tasks/base.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/tasks/config.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/tasks/decorators.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/tasks/registry.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/tasks/scheduler.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/tasks/worker.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/tenancy.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/testing/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/testing/assertions.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/testing/client.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/testing/database.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/testing/factories.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/testing/mocks.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/testing/plugin.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/validation.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/validators.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/core/views.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/01-quickstart.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/02-viewsets.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/03-authentication.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/04-messaging.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/05-multi-service.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/06-tasks.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/07-deployment.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/08-complete-example.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/09-settings.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/10-migrations.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/11-permissions.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/12-auth-backends.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/13-validators.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/14-querysets.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/15-routing.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/16-serializers.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/17-datetime.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/18-dependencies.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/19-views.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/20-fields.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/21-tenancy.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/22-replicas.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/23-soft-delete.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/24-relations.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/25-exceptions.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/26-choices.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/27-workers.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/28-avro.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/29-topics.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/30-changelog-0.12.2.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/31-middleware.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/32-migration-guide-0.12.2.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/32-testing.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/33-changelog-0.12.3.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/99-faq-troubleshooting.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/GUIDE.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/docs/README.md +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/example/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/example/app.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/example/auth.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/example/models.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/example/schemas.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/example/views.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/libs/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/main.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/tests/__init__.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/tests/conftest.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/tests/test_auth_helpers.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/tests/test_imports.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/tests/test_models.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/tests/test_permissions.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/tests/test_querysets.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/tests/test_serializers.py +0 -0
- {core_framework-0.12.13 → core_framework-0.12.14}/tests/test_validation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: core-framework
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.14
|
|
4
4
|
Summary: Core Framework - Django-inspired, FastAPI-powered. Alta performance, baixo acoplamento, produtividade extrema.
|
|
5
5
|
Project-URL: Homepage, https://github.com/SorPuti/core-framework
|
|
6
6
|
Project-URL: Documentation, https://github.com/SorPuti/core-framework#readme
|
|
@@ -52,6 +52,41 @@ if TYPE_CHECKING:
|
|
|
52
52
|
MIGRATIONS_TABLE = "_core_migrations"
|
|
53
53
|
|
|
54
54
|
|
|
55
|
+
def _detect_extra_imports(ops_code: str) -> list[str]:
|
|
56
|
+
"""
|
|
57
|
+
Detect and return extra import statements needed for migration code.
|
|
58
|
+
|
|
59
|
+
Analyzes the generated operation code to find references like:
|
|
60
|
+
- timezone.now -> from core.datetime import timezone
|
|
61
|
+
- AdvancedField.xxx -> from core.fields import AdvancedField
|
|
62
|
+
|
|
63
|
+
Args:
|
|
64
|
+
ops_code: The generated operation code string
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
List of import statements to add to the migration file
|
|
68
|
+
"""
|
|
69
|
+
imports = set()
|
|
70
|
+
|
|
71
|
+
# Patterns for short-form callable references
|
|
72
|
+
# These match the output of _serialize_default()
|
|
73
|
+
patterns = [
|
|
74
|
+
# timezone.xxx -> from core.datetime import timezone
|
|
75
|
+
# Match timezone.now but not datetime.timezone.now
|
|
76
|
+
(r'(?<![.\w])timezone\.\w+', 'from core.datetime import timezone'),
|
|
77
|
+
# AdvancedField.xxx -> from core.fields import AdvancedField
|
|
78
|
+
(r'(?<![.\w])AdvancedField\.\w+', 'from core.fields import AdvancedField'),
|
|
79
|
+
# datetime.xxx -> from datetime import datetime (for full module path)
|
|
80
|
+
(r'(?<![.\w])datetime\.\w+', 'from datetime import datetime'),
|
|
81
|
+
]
|
|
82
|
+
|
|
83
|
+
for pattern, import_stmt in patterns:
|
|
84
|
+
if re.search(pattern, ops_code):
|
|
85
|
+
imports.add(import_stmt)
|
|
86
|
+
|
|
87
|
+
return sorted(imports)
|
|
88
|
+
|
|
89
|
+
|
|
55
90
|
def _get_migrations_table_sql(dialect: str) -> str:
|
|
56
91
|
"""
|
|
57
92
|
Returns dialect-specific SQL for creating migrations table.
|
|
@@ -442,6 +477,10 @@ class MigrationEngine:
|
|
|
442
477
|
|
|
443
478
|
ops_str = ",\n".join(ops_code) if ops_code else " # No operations"
|
|
444
479
|
|
|
480
|
+
# Detect and add extra imports needed for callable defaults
|
|
481
|
+
extra_imports = _detect_extra_imports(ops_str)
|
|
482
|
+
extra_imports_str = "\n".join(extra_imports) + "\n" if extra_imports else ""
|
|
483
|
+
|
|
445
484
|
return f'''"""
|
|
446
485
|
Migration: {name}
|
|
447
486
|
Generated at: {timezone.now().isoformat()}
|
|
@@ -467,7 +506,7 @@ from core.migrations.operations import (
|
|
|
467
506
|
DropEnum,
|
|
468
507
|
AlterEnum,
|
|
469
508
|
)
|
|
470
|
-
|
|
509
|
+
{extra_imports_str}
|
|
471
510
|
|
|
472
511
|
migration = Migration(
|
|
473
512
|
name="{name}",
|
|
@@ -26,7 +26,7 @@ def _serialize_default(value: Any) -> str:
|
|
|
26
26
|
- None -> "None"
|
|
27
27
|
- Strings -> repr()
|
|
28
28
|
- Booleans -> "True"/"False"
|
|
29
|
-
- Callables -> "
|
|
29
|
+
- Callables -> short name (e.g., "timezone.now" not "core.datetime.timezone.now")
|
|
30
30
|
- Other -> repr()
|
|
31
31
|
|
|
32
32
|
Args:
|
|
@@ -41,11 +41,21 @@ def _serialize_default(value: Any) -> str:
|
|
|
41
41
|
if callable(value):
|
|
42
42
|
# Get module and function name for proper serialization
|
|
43
43
|
module = getattr(value, "__module__", "")
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if module and
|
|
47
|
-
#
|
|
48
|
-
|
|
44
|
+
qualname = getattr(value, "__qualname__", "") or getattr(value, "__name__", "")
|
|
45
|
+
|
|
46
|
+
if module and qualname:
|
|
47
|
+
# Use short form for known modules to avoid long paths
|
|
48
|
+
# e.g., "core.datetime.timezone.now" -> "timezone.now"
|
|
49
|
+
# The corresponding import will be added to the migration file
|
|
50
|
+
if module == "core.datetime" and qualname.startswith("timezone."):
|
|
51
|
+
return qualname # Returns "timezone.now"
|
|
52
|
+
if module == "core.fields" and qualname.startswith("AdvancedField."):
|
|
53
|
+
return qualname # Returns "AdvancedField.json_field..."
|
|
54
|
+
if module == "datetime":
|
|
55
|
+
return f"datetime.{qualname}" # Returns "datetime.now"
|
|
56
|
+
|
|
57
|
+
# For other modules, return full path
|
|
58
|
+
return f"{module}.{qualname}"
|
|
49
59
|
|
|
50
60
|
# Fallback for lambdas or unnamed functions
|
|
51
61
|
return "None"
|
|
@@ -139,10 +149,30 @@ class ColumnDef:
|
|
|
139
149
|
|
|
140
150
|
Returns:
|
|
141
151
|
String SQL para o default ou None
|
|
152
|
+
|
|
153
|
+
Note:
|
|
154
|
+
Callable defaults (like timezone.now) cannot be used as SQL DEFAULT.
|
|
155
|
+
They are handled by the application layer when creating records.
|
|
156
|
+
For timestamp defaults, use server-side defaults like CURRENT_TIMESTAMP.
|
|
142
157
|
"""
|
|
143
158
|
if self.default is None:
|
|
144
159
|
return None
|
|
145
160
|
|
|
161
|
+
# Callable defaults cannot be used in SQL - they're Python functions
|
|
162
|
+
# The ORM handles these when creating records
|
|
163
|
+
if callable(self.default):
|
|
164
|
+
# For datetime-related callables, use SQL equivalent
|
|
165
|
+
func_name = getattr(self.default, "__name__", "") or getattr(self.default, "__qualname__", "")
|
|
166
|
+
if "now" in func_name.lower() or "utcnow" in func_name.lower():
|
|
167
|
+
if dialect == "postgresql":
|
|
168
|
+
return "DEFAULT CURRENT_TIMESTAMP"
|
|
169
|
+
elif dialect == "sqlite":
|
|
170
|
+
return "DEFAULT CURRENT_TIMESTAMP"
|
|
171
|
+
elif dialect == "mysql":
|
|
172
|
+
return "DEFAULT CURRENT_TIMESTAMP"
|
|
173
|
+
# For other callables, skip DEFAULT (handled by ORM)
|
|
174
|
+
return None
|
|
175
|
+
|
|
146
176
|
if isinstance(self.default, str):
|
|
147
177
|
return f"DEFAULT '{self.default}'"
|
|
148
178
|
|
|
@@ -446,6 +476,27 @@ class AlterColumn(Operation):
|
|
|
446
476
|
if self.set_default:
|
|
447
477
|
changes.append(f"default to {self.new_default}")
|
|
448
478
|
return f"Alter column '{self.column_name}' in '{self.table_name}': {', '.join(changes)}"
|
|
479
|
+
|
|
480
|
+
def to_code(self) -> str:
|
|
481
|
+
"""Gera código Python para AlterColumn com serialização correta de callables."""
|
|
482
|
+
new_type_str = f"'{self.new_type}'" if self.new_type else "None"
|
|
483
|
+
old_type_str = f"'{self.old_type}'" if self.old_type else "None"
|
|
484
|
+
|
|
485
|
+
# Serializa defaults corretamente (callables, None, strings, etc.)
|
|
486
|
+
new_default_str = _serialize_default(self.new_default)
|
|
487
|
+
old_default_str = _serialize_default(self.old_default)
|
|
488
|
+
|
|
489
|
+
return f"""AlterColumn(
|
|
490
|
+
table_name='{self.table_name}',
|
|
491
|
+
column_name='{self.column_name}',
|
|
492
|
+
new_type={new_type_str},
|
|
493
|
+
new_nullable={self.new_nullable},
|
|
494
|
+
new_default={new_default_str},
|
|
495
|
+
set_default={self.set_default},
|
|
496
|
+
old_type={old_type_str},
|
|
497
|
+
old_nullable={self.old_nullable},
|
|
498
|
+
old_default={old_default_str},
|
|
499
|
+
)"""
|
|
449
500
|
|
|
450
501
|
|
|
451
502
|
@dataclass
|
|
@@ -251,6 +251,31 @@ class TestIssue5MigrationSerialization:
|
|
|
251
251
|
assert "0x" not in code
|
|
252
252
|
# Should contain proper reference
|
|
253
253
|
assert "CreateTable" in code
|
|
254
|
+
|
|
255
|
+
def test_alter_column_to_code_with_callable(self):
|
|
256
|
+
"""AlterColumn.to_code() should serialize callable defaults correctly."""
|
|
257
|
+
from core.migrations.operations import AlterColumn
|
|
258
|
+
from core.datetime import timezone
|
|
259
|
+
|
|
260
|
+
op = AlterColumn(
|
|
261
|
+
table_name="users",
|
|
262
|
+
column_name="created_at",
|
|
263
|
+
new_type="DATETIME",
|
|
264
|
+
new_default=timezone.now,
|
|
265
|
+
set_default=True,
|
|
266
|
+
old_type="TIMESTAMP",
|
|
267
|
+
old_default=None,
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
code = op.to_code()
|
|
271
|
+
|
|
272
|
+
# Should NOT contain <function ... at 0x...>
|
|
273
|
+
assert "<function" not in code, f"Generated invalid code: {code}"
|
|
274
|
+
assert "0x" not in code, f"Generated memory address: {code}"
|
|
275
|
+
# Should be valid Python
|
|
276
|
+
assert "AlterColumn" in code
|
|
277
|
+
# Should have proper serialization
|
|
278
|
+
assert "core.datetime.timezone.now" in code or "timezone.now" in code
|
|
254
279
|
|
|
255
280
|
|
|
256
281
|
class TestIssue6ResetDbCascade:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|