diff options
author | Tim Graham <timograham@gmail.com> | 2014-07-07 19:08:42 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2014-07-07 19:08:42 -0400 |
commit | 89b9e6e5d68297e7fe10baea6abcd96e24de0e09 (patch) | |
tree | 9d401d0ed234e93c53f2c75c21500d6d530596a3 /tests/raw_query | |
parent | 54546cee88f1db4e7e0ad75ebb9672c118b2236c (diff) | |
download | django-89b9e6e5d68297e7fe10baea6abcd96e24de0e09.tar.gz |
Fixed #22909 -- Removed camelCasing in some tests.
Thanks brylie.
Diffstat (limited to 'tests/raw_query')
-rw-r--r-- | tests/raw_query/tests.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/raw_query/tests.py b/tests/raw_query/tests.py index 17479df6cd..80372c1ae0 100644 --- a/tests/raw_query/tests.py +++ b/tests/raw_query/tests.py @@ -59,7 +59,7 @@ class RawQueryTests(TestCase): self.assertTrue(hasattr(result, annotation)) self.assertEqual(getattr(result, annotation), value) - def testSimpleRawQuery(self): + def test_simple_raw_query(self): """ Basic test of raw query with a simple database query """ @@ -67,7 +67,7 @@ class RawQueryTests(TestCase): authors = Author.objects.all() self.assertSuccessfulRawQuery(Author, query, authors) - def testRawQueryLazy(self): + def test_raw_query_lazy(self): """ Raw queries are lazy: they aren't actually executed until they're iterated over. @@ -77,7 +77,7 @@ class RawQueryTests(TestCase): list(q) self.assertTrue(q.query.cursor is not None) - def testFkeyRawQuery(self): + def test_FK_raw_query(self): """ Test of a simple raw query against a model containing a foreign key """ @@ -85,7 +85,7 @@ class RawQueryTests(TestCase): books = Book.objects.all() self.assertSuccessfulRawQuery(Book, query, books) - def testDBColumnHandler(self): + def test_db_column_handler(self): """ Test of a simple raw query against a model containing a field with db_column defined. @@ -94,7 +94,7 @@ class RawQueryTests(TestCase): coffees = Coffee.objects.all() self.assertSuccessfulRawQuery(Coffee, query, coffees) - def testOrderHandler(self): + def test_order_handler(self): """ Test of raw raw query's tolerance for columns being returned in any order @@ -110,7 +110,7 @@ class RawQueryTests(TestCase): authors = Author.objects.all() self.assertSuccessfulRawQuery(Author, query, authors) - def testTranslations(self): + def test_translations(self): """ Test of raw query's optional ability to translate unexpected result column names to specific model fields @@ -120,7 +120,7 @@ class RawQueryTests(TestCase): authors = Author.objects.all() self.assertSuccessfulRawQuery(Author, query, authors, translations=translations) - def testParams(self): + def test_params(self): """ Test passing optional query parameters """ @@ -135,7 +135,7 @@ class RawQueryTests(TestCase): self.assertIsInstance(repr(qset), str) @skipUnlessDBFeature('supports_paramstyle_pyformat') - def testPyformatParams(self): + def test_pyformat_params(self): """ Test passing optional query parameters """ @@ -149,7 +149,7 @@ class RawQueryTests(TestCase): self.assertEqual(len(results), 1) self.assertIsInstance(repr(qset), str) - def testManyToMany(self): + def test_many_to_many(self): """ Test of a simple raw query against a model containing a m2m field """ @@ -157,7 +157,7 @@ class RawQueryTests(TestCase): reviewers = Reviewer.objects.all() self.assertSuccessfulRawQuery(Reviewer, query, reviewers) - def testExtraConversions(self): + def test_extra_conversions(self): """ Test to insure that extra translations are ignored. """ @@ -166,14 +166,14 @@ class RawQueryTests(TestCase): authors = Author.objects.all() self.assertSuccessfulRawQuery(Author, query, authors, translations=translations) - def testMissingFields(self): + def test_missing_fields(self): query = "SELECT id, first_name, dob FROM raw_query_author" for author in Author.objects.raw(query): self.assertNotEqual(author.first_name, None) # last_name isn't given, but it will be retrieved on demand self.assertNotEqual(author.last_name, None) - def testMissingFieldsWithoutPK(self): + def test_missing_fields_without_PK(self): query = "SELECT first_name, dob FROM raw_query_author" try: list(Author.objects.raw(query)) @@ -181,7 +181,7 @@ class RawQueryTests(TestCase): except InvalidQuery: pass - def testAnnotations(self): + def test_annotations(self): query = "SELECT a.*, count(b.id) as book_count FROM raw_query_author a LEFT JOIN raw_query_book b ON a.id = b.author_id GROUP BY a.id, a.first_name, a.last_name, a.dob ORDER BY a.id" expected_annotations = ( ('book_count', 3), @@ -192,12 +192,12 @@ class RawQueryTests(TestCase): authors = Author.objects.all() self.assertSuccessfulRawQuery(Author, query, authors, expected_annotations) - def testWhiteSpaceQuery(self): + def test_white_space_query(self): query = " SELECT * FROM raw_query_author" authors = Author.objects.all() self.assertSuccessfulRawQuery(Author, query, authors) - def testMultipleIterations(self): + def test_multiple_iterations(self): query = "SELECT * FROM raw_query_author" normal_authors = Author.objects.all() raw_authors = Author.objects.raw(query) @@ -216,7 +216,7 @@ class RawQueryTests(TestCase): self.assertEqual(first_iterations, second_iterations) - def testGetItem(self): + def test_get_item(self): # Indexing on RawQuerySets query = "SELECT * FROM raw_query_author ORDER BY id ASC" third_author = Author.objects.raw(query)[2] |