diff --git a/tests/select_for_update/tests.py b/tests/select_for_update/tests.py
index f9e7e96..5c2743f 100644
--- a/tests/select_for_update/tests.py
+++ b/tests/select_for_update/tests.py
@@ -137,6 +137,14 @@ class SelectForUpdateTests(TransactionTestCase):
             Person.objects.all().select_for_update(nowait=True)
         )
 
+    @skipUnlessDBFeature('has_select_for_update')
+    def test_select_for_update_str(self):
+        # regression test for #20647
+        self.assertEqual(
+            str(Person.objects.all().select_for_update()),
+            '[<Person: Person object>]'
+        )
+
     def run_select_for_update(self, status, nowait=False):
         """
         Utility method that runs a SELECT FOR UPDATE against all
