From e6eff674c0afd4dc84503ccbe3640e7d8914983c Mon Sep 17 00:00:00 2001 From: Cassidy Symons <83246693+cassidysymons@users.noreply.github.com> Date: Mon, 21 Nov 2022 08:50:30 -0800 Subject: [PATCH 1/2] Daklapack Article Code Updates --- microsetta_private_api/db/patches/0105.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 microsetta_private_api/db/patches/0105.sql diff --git a/microsetta_private_api/db/patches/0105.sql b/microsetta_private_api/db/patches/0105.sql new file mode 100644 index 000000000..7a72bda8d --- /dev/null +++ b/microsetta_private_api/db/patches/0105.sql @@ -0,0 +1,9 @@ +-- Add new article codes for matrix tube kits +INSERT INTO barcodes.daklapack_article (dak_article_code, short_description, detailed_description) VALUES ('3510005E', 'TMI 1matrix tube', 'TMI 1 matrix tube, American English'); +INSERT INTO barcodes.daklapack_article (dak_article_code, short_description, detailed_description) VALUES ('3510006E', 'TMI 1matrix tube', 'TMI 1 matrix tube, American English, no inbound label'); +INSERT INTO barcodes.daklapack_article (dak_article_code, short_description, detailed_description) VALUES ('3510006M', 'TMI 1matrix tube', 'TMI 1 matrix tube, Mexican Spanish, no inbound label'); +INSERT INTO barcodes.daklapack_article (dak_article_code, short_description, detailed_description) VALUES ('3510006S', 'TMI 1matrix tube', 'TMI 1 matrix tube, Spanish, no inbound label'); +INSERT INTO barcodes.daklapack_article (dak_article_code, short_description, detailed_description) VALUES ('3510006J', 'TMI 1matrix tube', 'TMI 1 matrix tube, Japanese, no inbound label'); + +-- Retire old kit configurations that we won't be using in the future +UPDATE barcodes.daklapack_article SET retired = true WHERE dak_article_code IN ('3510000E', '3510001E', '3511000E', '3541002E', '3510001M', '3510001S', '3510001J', '3521003E'); From 216f841551a4f58a2fc4d602074da862b8458c54 Mon Sep 17 00:00:00 2001 From: Cassidy Symons <83246693+cassidysymons@users.noreply.github.com> Date: Mon, 21 Nov 2022 11:56:20 -0800 Subject: [PATCH 2/2] Fix tests --- microsetta_private_api/admin/tests/test_admin_repo.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/microsetta_private_api/admin/tests/test_admin_repo.py b/microsetta_private_api/admin/tests/test_admin_repo.py index d406822ba..f3e07e61f 100644 --- a/microsetta_private_api/admin/tests/test_admin_repo.py +++ b/microsetta_private_api/admin/tests/test_admin_repo.py @@ -20,10 +20,10 @@ STANDARD_ACCT_ID = "12345678-bbbb-cccc-dddd-eeeeffffffff" ADMIN_ACCT_ID = "12345678-1234-1234-1234-123412341234" -FIRST_LIVE_DAK_ARTICLE = {'dak_article_code': '3510000E', - 'short_description': 'TMI 1 tube', +FIRST_LIVE_DAK_ARTICLE = {'dak_article_code': '3510005E', + 'short_description': 'TMI 1matrix tube', 'detailed_description': - 'TMI 1 tube, American English' + 'TMI 1 matrix tube, American English' } # This is the first one in the db, but it is retired FIRST_DAK_ARTICLE = {'dak_article_code': '350103', @@ -994,7 +994,7 @@ def test_get_daklapack_articles_not_retired(self): with Transaction() as t: admin_repo = AdminRepo(t) articles = admin_repo.get_daklapack_articles() - self.assertEqual(11, len(articles)) + self.assertEqual(8, len(articles)) first_article = articles[0] first_article.pop("dak_article_id") self.assertEqual(FIRST_LIVE_DAK_ARTICLE, first_article) @@ -1003,7 +1003,7 @@ def test_get_daklapack_articles_all(self): with Transaction() as t: admin_repo = AdminRepo(t) articles = admin_repo.get_daklapack_articles(include_retired=True) - self.assertEqual(19, len(articles)) + self.assertEqual(24, len(articles)) first_article = articles[0] first_article.pop("dak_article_id") self.assertEqual(FIRST_DAK_ARTICLE, first_article)