|
4 | 4 | from django.test import RequestFactory, TestCase, override_settings |
5 | 5 |
|
6 | 6 | from django_mongodb_extensions.mql_panel import MQLPanel |
7 | | -from django_mongodb_extensions.mql_panel.forms import MQLQueryForm |
8 | 7 |
|
9 | 8 | rf = RequestFactory() |
10 | 9 |
|
@@ -139,32 +138,3 @@ def test_query_width_ratio(self): |
139 | 138 | self.panel.generate_stats(self.request, response) |
140 | 139 | total_width = sum(q["width_ratio"] for q in self.panel._queries) |
141 | 140 | self.assertAlmostEqual(total_width, 100, places=5) |
142 | | - |
143 | | - |
144 | | -class ConvertDocumentsToTableTests(TestCase): |
145 | | - def setUp(self): |
146 | | - self.form = MQLQueryForm() |
147 | | - |
148 | | - def test_empty_documents(self): |
149 | | - """Empty document list returns empty rows and headers.""" |
150 | | - rows, headers = self.form.convert_documents_to_table([]) |
151 | | - self.assertEqual(rows, []) |
152 | | - self.assertEqual(headers, []) |
153 | | - |
154 | | - def test_handle_operation_error_format(self): |
155 | | - """Error return format matches convert_documents_to_table format.""" |
156 | | - error = ValueError("Test error") |
157 | | - mql_string = "db.test.aggregate([])" |
158 | | - rows, headers = self.form._handle_operation_error(error, mql_string, "query") |
159 | | - |
160 | | - # Should return one row with one cell |
161 | | - self.assertEqual(len(rows), 1) |
162 | | - self.assertEqual(len(rows[0]), 1) |
163 | | - |
164 | | - # Cell should be a dict with 'value' and 'is_json' keys |
165 | | - cell = rows[0][0] |
166 | | - self.assertIsInstance(cell["value"], str) |
167 | | - self.assertIs(cell["is_json"], False) |
168 | | - |
169 | | - # Should have one header |
170 | | - self.assertEqual(headers[0], "Query Parsing Error") |
0 commit comments