diff --git a/dags/hivemind_etl_helpers/src/db/telegram/utils/platform.py b/dags/hivemind_etl_helpers/src/db/telegram/utils/platform.py index 5dea1da1..775b0413 100644 --- a/dags/hivemind_etl_helpers/src/db/telegram/utils/platform.py +++ b/dags/hivemind_etl_helpers/src/db/telegram/utils/platform.py @@ -52,6 +52,7 @@ def create_platform(self) -> ObjectId: community_id = ObjectId() self._client[self.database][self.collection].insert_one( { + "name": "telegram", "metadata": { "id": self.chat_id, "name": self.chat_name, diff --git a/dags/hivemind_etl_helpers/tests/integration/test_telegram_comminity.py b/dags/hivemind_etl_helpers/tests/integration/test_telegram_comminity.py index 733f0cc7..33b8c7b4 100644 --- a/dags/hivemind_etl_helpers/tests/integration/test_telegram_comminity.py +++ b/dags/hivemind_etl_helpers/tests/integration/test_telegram_comminity.py @@ -18,6 +18,9 @@ def setUp(self) -> None: self.telegram_platform.database = "TempPlatforms" self.client.drop_database(self.telegram_platform.database) + def tearDown(self) -> None: + self.client.drop_database(self.telegram_platform.database) + def test_check_no_platform_available(self): result = self.telegram_platform.check_platform_existence() self.assertFalse(result) @@ -29,6 +32,7 @@ def test_single_platform_available(self): self.telegram_platform.collection ].insert_one( { + "name": "telegram", "metadata": { "id": self.chat_id, "name": self.chat_name, @@ -55,6 +59,7 @@ def test_telegram_multiple_platform_not_available(self): ].insert_many( [ { + "name": "telegram", "metadata": { "id": chat_id, "name": chat_name, @@ -65,6 +70,7 @@ def test_telegram_multiple_platform_not_available(self): "updatedAt": datetime.now(), }, { + "name": "telegram", "metadata": { "id": chat_id2, "name": chat_name2, @@ -75,6 +81,7 @@ def test_telegram_multiple_platform_not_available(self): "updatedAt": datetime.now(), }, { + "name": "telegram", "metadata": { "id": chat_id3, "name": chat_name3,