File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 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(
104104 Name of the database connection to use.
105105 """
106106
107- suffix = timezone .now ().strftime ("%Y%m%d%H%m%s " )
107+ suffix = timezone .now ().strftime ("%Y%m%d%H%m%S " )
108108 cls ._verify_generated_name_length (prefix , suffix )
109109
110110 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():
5555
5656
5757def 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 " ):
5959 schema = PostgresSchema .create_time_based ("myprefix" )
6060
61- assert schema .name == "myprefix_2023040713041680892620 "
61+ assert schema .name == "myprefix_20230407130423 "
6262 assert _does_schema_exist (schema .name )
6363
6464
6565def test_postgres_schema_create_time_based_long_prefix ():
6666 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 )
6869
69- assert "is longer than 55 characters" in str (exc_info .value )
70+ assert "is longer than 49 characters" in str (exc_info .value )
7071
7172
7273def test_postgres_schema_create_random ():
You can’t perform that action at this time.
0 commit comments