From 02f19ec7eec6cde7b82ea6d25bed4a544eadc2bd Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Jan 2021 21:00:10 -0500 Subject: [PATCH] added more decimal tests --- tests/mysql/schema/test_mysql_schema_builder.py | 5 +++-- tests/postgres/schema/test_postgres_schema_builder.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/mysql/schema/test_mysql_schema_builder.py b/tests/mysql/schema/test_mysql_schema_builder.py index 81f4c6db..53b6a8da 100644 --- a/tests/mysql/schema/test_mysql_schema_builder.py +++ b/tests/mysql/schema/test_mysql_schema_builder.py @@ -65,17 +65,18 @@ def test_can_advanced_table_creation(self): blueprint.string("name") blueprint.string("email").unique() blueprint.string("password") + blueprint.decimal("money") blueprint.integer("admin").default(0) blueprint.string("remember_token").nullable() blueprint.timestamp("verified_at").nullable() blueprint.timestamps() - self.assertEqual(len(blueprint.table.added_columns), 9) + self.assertEqual(len(blueprint.table.added_columns), 10) self.assertEqual( blueprint.to_sql(), ( "CREATE TABLE users (id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, " - "name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, " + "name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, money DECIMAL(17, 6) NOT NULL, " "admin INT(11) NOT NULL DEFAULT 0, remember_token VARCHAR(255) NULL, verified_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, " "created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, CONSTRAINT users_email_unique UNIQUE (email))" ), diff --git a/tests/postgres/schema/test_postgres_schema_builder.py b/tests/postgres/schema/test_postgres_schema_builder.py index 2dc039b7..ac59c904 100644 --- a/tests/postgres/schema/test_postgres_schema_builder.py +++ b/tests/postgres/schema/test_postgres_schema_builder.py @@ -112,6 +112,7 @@ def test_can_advanced_table_creation2(self): blueprint.increments("id") blueprint.string("name") blueprint.string("duration") + blueprint.decimal("money") blueprint.string("url") blueprint.datetime("published_at") blueprint.string("thumbnail").nullable() @@ -123,12 +124,12 @@ def test_can_advanced_table_creation2(self): blueprint.text("description") blueprint.timestamps() - self.assertEqual(len(blueprint.table.added_columns), 11) + self.assertEqual(len(blueprint.table.added_columns), 12) self.assertEqual( blueprint.to_sql(), ( 'CREATE TABLE "users" (id SERIAL UNIQUE NOT NULL, name VARCHAR(255) NOT NULL, ' - "duration VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, published_at TIMESTAMP NOT NULL, " + "duration VARCHAR(255) NOT NULL, money DECIMAL(17, 6) NOT NULL, url VARCHAR(255) NOT NULL, published_at TIMESTAMP NOT NULL, " "thumbnail VARCHAR(255) NULL, premium INTEGER NOT NULL, author_id INT NULL, " "description TEXT NOT NULL, created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, " "updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, "