File tree 2 files changed +6
-5
lines changed 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ def create_time_based(
104
104
Name of the database connection to use.
105
105
"""
106
106
107
- suffix = timezone .now ().strftime ("%Y%m%d%H%m%s " )
107
+ suffix = timezone .now ().strftime ("%Y%m%d%H%m%S " )
108
108
cls ._verify_generated_name_length (prefix , suffix )
109
109
110
110
return cls .create (f"{ prefix } _{ suffix } " , using = using )
Original file line number Diff line number Diff line change @@ -55,18 +55,19 @@ def test_postgres_schema_create_name_that_requires_escaping():
55
55
56
56
57
57
def test_postgres_schema_create_time_based ():
58
- with freezegun .freeze_time ("2023-04-07 13:37:00.0 " ):
58
+ with freezegun .freeze_time ("2023-04-07 13:37:23.4 " ):
59
59
schema = PostgresSchema .create_time_based ("myprefix" )
60
60
61
- assert schema .name == "myprefix_2023040713041680892620 "
61
+ assert schema .name == "myprefix_20230407130423 "
62
62
assert _does_schema_exist (schema .name )
63
63
64
64
65
65
def test_postgres_schema_create_time_based_long_prefix ():
66
66
with pytest .raises (ValidationError ) as exc_info :
67
- PostgresSchema .create_time_based ("a" * 100 )
67
+ with freezegun .freeze_time ("2023-04-07 13:37:23.4" ):
68
+ PostgresSchema .create_time_based ("a" * 100 )
68
69
69
- assert "is longer than 55 characters" in str (exc_info .value )
70
+ assert "is longer than 49 characters" in str (exc_info .value )
70
71
71
72
72
73
def test_postgres_schema_create_random ():
You can’t perform that action at this time.
0 commit comments