Permalink
Browse files

Modified camel case test names.

  • Loading branch information...
1 parent bf34e61 commit f12558b8b9db7f8a43f018c7735ade57ebaf2930 @brylie committed Jun 30, 2014
Showing with 16 additions and 16 deletions.
  1. +16 −16 tests/raw_query/tests.py
View
@@ -59,15 +59,15 @@ def assertAnnotations(self, results, expected_annotations):
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
"""
query = "SELECT * FROM raw_query_author"
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,15 +77,15 @@ def testRawQueryLazy(self):
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
"""
query = "SELECT * FROM raw_query_book"
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 @@ def testDBColumnHandler(self):
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 @@ def testOrderHandler(self):
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 @@ def testTranslations(self):
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 @@ def testParams(self):
self.assertIsInstance(repr(qset), str)
@skipUnlessDBFeature('supports_paramstyle_pyformat')
- def testPyformatParams(self):
+ def test_pyformat_params(self):
"""
Test passing optional query parameters
"""
@@ -149,15 +149,15 @@ def testPyformatParams(self):
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
"""
query = "SELECT * FROM raw_query_reviewer"
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,22 +166,22 @@ def testExtraConversions(self):
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))
self.fail('Query without primary key should fail')
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 @@ def testAnnotations(self):
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 @@ def testMultipleIterations(self):
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]

0 comments on commit f12558b

Please sign in to comment.