(self)
| 208 | Article.objects.in_bulk(headline__startswith="Blah") |
| 209 | |
| 210 | def test_in_bulk_lots_of_ids(self): |
| 211 | test_range = 2000 |
| 212 | max_query_params = connection.features.max_query_params |
| 213 | expected_num_queries = ( |
| 214 | ceil(test_range / max_query_params) if max_query_params else 1 |
| 215 | ) |
| 216 | Author.objects.bulk_create( |
| 217 | [Author() for i in range(test_range - Author.objects.count())] |
| 218 | ) |
| 219 | authors = {author.pk: author for author in Author.objects.all()} |
| 220 | with self.assertNumQueries(expected_num_queries): |
| 221 | self.assertEqual(Author.objects.in_bulk(authors), authors) |
| 222 | |
| 223 | def test_in_bulk_with_field(self): |
| 224 | self.assertEqual( |
nothing calls this directly
no test coverage detected