(self)
| 1057 | |
| 1058 | @skipUnlessDBFeature("has_select_for_update") |
| 1059 | def test_refresh_for_update(self): |
| 1060 | a = Article.objects.create(pub_date=datetime.now()) |
| 1061 | for_update_sql = connection.ops.for_update_sql() |
| 1062 | |
| 1063 | with transaction.atomic(), CaptureQueriesContext(connection) as ctx: |
| 1064 | a.refresh_from_db(from_queryset=Article.objects.select_for_update()) |
| 1065 | self.assertTrue( |
| 1066 | any(for_update_sql in query["sql"] for query in ctx.captured_queries) |
| 1067 | ) |
| 1068 | |
| 1069 | def test_refresh_with_related(self): |
| 1070 | a = Article.objects.create(pub_date=datetime.now()) |
nothing calls this directly
no test coverage detected