From: Daniel Haaker Date: Sat, 20 Oct 2012 22:08:58 +0000 (+0200) Subject: Fix bug with minute component in file_template and make sure it is tested correctly X-Git-Tag: rel_0_4_1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b9229b0f851d429f70d5ef7620a4302c493a89b;p=thirdparty%2Fsqlalchemy%2Falembic.git Fix bug with minute component in file_template and make sure it is tested correctly --- diff --git a/CHANGES b/CHANGES index 9d551ecd..8e7ab6bf 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,9 @@ from operations.create_table() documentation. #81 +- [bug] Fixed the minute component in file_template + which returned the month part of the create date. + 0.4.0 ===== - [feature] Support for tables in alternate schemas diff --git a/alembic/script.py b/alembic/script.py index b411fb97..68d266ea 100644 --- a/alembic/script.py +++ b/alembic/script.py @@ -227,7 +227,7 @@ class ScriptDirectory(object): 'month': create_date.month, 'day': create_date.day, 'hour': create_date.hour, - 'minute': create_date.month, + 'minute': create_date.minute, 'second': create_date.second } ) diff --git a/tests/test_revision_create.py b/tests/test_revision_create.py index 78a628a2..fd9a7ed7 100644 --- a/tests/test_revision_create.py +++ b/tests/test_revision_create.py @@ -105,11 +105,11 @@ class ScriptNamingTest(unittest.TestCase): "%(day)s_%(hour)s_" "%(minute)s_%(second)s" ) - create_date = datetime.datetime(2012, 5, 25, 15, 8, 5) + create_date = datetime.datetime(2012, 7, 25, 15, 8, 5) eq_( script._rev_path("12345", "this is a message", create_date), "%s/versions/12345_this_is_a_" - "message_2012_5_25_15_5_5.py" % staging_directory + "message_2012_7_25_15_8_5.py" % staging_directory )