Loading django/db/backends/postgresql_psycopg2/base.py +0 −2 Original line number Diff line number Diff line Loading @@ -4,8 +4,6 @@ PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import sys from django.conf import settings from django.db.backends import (BaseDatabaseFeatures, BaseDatabaseWrapper, BaseDatabaseValidation) Loading tests/get_or_create/tests.py +8 −9 Original line number Diff line number Diff line Loading @@ -19,40 +19,38 @@ class GetOrCreateTests(TestCase): ) def test_get_or_create_method_with_get(self): p, created = Person.objects.get_or_create( created = Person.objects.get_or_create( first_name="John", last_name="Lennon", defaults={ "birthday": date(1940, 10, 9) } ) )[1] self.assertFalse(created) self.assertEqual(Person.objects.count(), 1) def test_get_or_create_method_with_create(self): p, created = Person.objects.get_or_create( created = Person.objects.get_or_create( first_name='George', last_name='Harrison', defaults={ 'birthday': date(1943, 2, 25) } ) )[1] self.assertTrue(created) self.assertEqual(Person.objects.count(), 2) def test_get_or_create_redundant_instance(self): """ If we execute the exact same statement twice, the second time, it won't create a Person. """ george, created = Person.objects.get_or_create( Person.objects.get_or_create( first_name='George', last_name='Harrison', defaults={ 'birthday': date(1943, 2, 25) } ) evil_george, created = Person.objects.get_or_create( created = Person.objects.get_or_create( first_name='George', last_name='Harrison', defaults={ 'birthday': date(1943, 2, 25) } ) )[1] self.assertFalse(created) self.assertEqual(Person.objects.count(), 2) Loading @@ -67,6 +65,7 @@ class GetOrCreateTests(TestCase): Person.objects.get_or_create, first_name="Tom", last_name="Smith" ) class GetOrCreateTestsWithManualPKs(TestCase): def setUp(self): Loading tests/test_discovery_sample/doctests.py +2 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ Doctest example from the official Python documentation. https://docs.python.org/3/library/doctest.html """ def factorial(n): """Return the factorial of n, an exact integer >= 0. Loading tests/test_runner/test_discover_runner.py +0 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,6 @@ class DiscoverRunnerTest(TestCase): def test_testcase_ordering(self): suite = DiscoverRunner().build_suite(["test_discovery_sample/"]) tc_names = [case.__class__.__name__ for case in suite._tests] self.assertEqual( suite._tests[0].__class__.__name__, 'TestDjangoTestCase', Loading tests/prefetch_related/tests.py +1 −1 File changed.Contains only whitespace changes. Show changes Loading
django/db/backends/postgresql_psycopg2/base.py +0 −2 Original line number Diff line number Diff line Loading @@ -4,8 +4,6 @@ PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import sys from django.conf import settings from django.db.backends import (BaseDatabaseFeatures, BaseDatabaseWrapper, BaseDatabaseValidation) Loading
tests/get_or_create/tests.py +8 −9 Original line number Diff line number Diff line Loading @@ -19,40 +19,38 @@ class GetOrCreateTests(TestCase): ) def test_get_or_create_method_with_get(self): p, created = Person.objects.get_or_create( created = Person.objects.get_or_create( first_name="John", last_name="Lennon", defaults={ "birthday": date(1940, 10, 9) } ) )[1] self.assertFalse(created) self.assertEqual(Person.objects.count(), 1) def test_get_or_create_method_with_create(self): p, created = Person.objects.get_or_create( created = Person.objects.get_or_create( first_name='George', last_name='Harrison', defaults={ 'birthday': date(1943, 2, 25) } ) )[1] self.assertTrue(created) self.assertEqual(Person.objects.count(), 2) def test_get_or_create_redundant_instance(self): """ If we execute the exact same statement twice, the second time, it won't create a Person. """ george, created = Person.objects.get_or_create( Person.objects.get_or_create( first_name='George', last_name='Harrison', defaults={ 'birthday': date(1943, 2, 25) } ) evil_george, created = Person.objects.get_or_create( created = Person.objects.get_or_create( first_name='George', last_name='Harrison', defaults={ 'birthday': date(1943, 2, 25) } ) )[1] self.assertFalse(created) self.assertEqual(Person.objects.count(), 2) Loading @@ -67,6 +65,7 @@ class GetOrCreateTests(TestCase): Person.objects.get_or_create, first_name="Tom", last_name="Smith" ) class GetOrCreateTestsWithManualPKs(TestCase): def setUp(self): Loading
tests/test_discovery_sample/doctests.py +2 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ Doctest example from the official Python documentation. https://docs.python.org/3/library/doctest.html """ def factorial(n): """Return the factorial of n, an exact integer >= 0. Loading
tests/test_runner/test_discover_runner.py +0 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,6 @@ class DiscoverRunnerTest(TestCase): def test_testcase_ordering(self): suite = DiscoverRunner().build_suite(["test_discovery_sample/"]) tc_names = [case.__class__.__name__ for case in suite._tests] self.assertEqual( suite._tests[0].__class__.__name__, 'TestDjangoTestCase', Loading