mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Refs #27546 -- Tested some __repr__() methods.
This commit is contained in:
parent
78500102b7
commit
794b7d8033
5 changed files with 36 additions and 0 deletions
|
@ -3,6 +3,7 @@ from __future__ import unicode_literals
|
|||
from datetime import date
|
||||
from decimal import Decimal
|
||||
|
||||
from django.db.models.query import RawQuerySet
|
||||
from django.db.models.query_utils import InvalidQuery
|
||||
from django.test import TestCase, skipUnlessDBFeature
|
||||
|
||||
|
@ -90,6 +91,11 @@ class RawQueryTests(TestCase):
|
|||
self.assertTrue(hasattr(result, annotation))
|
||||
self.assertEqual(getattr(result, annotation), value)
|
||||
|
||||
def test_rawqueryset_repr(self):
|
||||
queryset = RawQuerySet(raw_query='SELECT * FROM raw_query_author')
|
||||
self.assertEqual(repr(queryset), '<RawQuerySet: SELECT * FROM raw_query_author>')
|
||||
self.assertEqual(repr(queryset.query), '<RawQuery: SELECT * FROM raw_query_author>')
|
||||
|
||||
def test_simple_raw_query(self):
|
||||
"""
|
||||
Basic test of raw query with a simple database query
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue