AAfghahi commented on a change in pull request #13893:
URL: https://github.com/apache/superset/pull/13893#discussion_r608708223



##########
File path: tests/queries/saved_queries/commands_tests.py
##########
@@ -108,3 +120,109 @@ def test_export_query_command_key_order(self, mock_g):
             "version",
             "database_uuid",
         ]
+class TestImportSavedQueriesCommand(SupersetTestCase):
+    def test_import_v1_saved_queries(self):
+        """Test that we can import a saved query"""
+        contents = {
+            "metadata.yaml": yaml.safe_dump(saved_queries_metadata_config),
+            "databases/imported_database.yaml": 
yaml.safe_dump(database_config),
+            "queries/imported_query.yaml": yaml.safe_dump(saved_queries_config)
+        }
+
+        command = ImportSavedQueriesCommand(contents)
+        command.run()
+
+        saved_query = db.session.query(SavedQuery).filter_by(
+            uuid=saved_queries_config["uuid"]
+        ).one()
+        assert saved_query.schema == "public"
+        assert saved_query.sql == (
+            """
+            -- Note: Unless you save your query, 
+            these tabs will NOT persist if you clear
+            your cookies or change browsers.
+
+            SELECT * from birth_names
+            """
+        )

Review comment:
       Yeah, they do. Was wondering about this actually, should I just not test 
the sql or is there a comment to disable the line is too long linter? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to