Ticket #22909: issue_22909.patch

File issue_22909.patch, 76.1 KB (added by brylie, 8 months ago)

Patch containing changes for test names in several test suites.

  • tests/admin_custom_urls/tests.py

    From e5fbf9087a0ea2e688e7fd351b174c88eba3e5a6 Mon Sep 17 00:00:00 2001
    From: Brylie Christopher Oxley <brylie@gnumedia.org>
    Date: Mon, 30 Jun 2014 12:10:06 +0300
    Subject: [PATCH 01/12] Fixing camel case test names.
    
    ---
     tests/admin_custom_urls/tests.py | 8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/tests/admin_custom_urls/tests.py b/tests/admin_custom_urls/tests.py
    index f804036..edabb6e 100644
    a b class AdminCustomUrlsTest(TestCase): 
    2525    def tearDown(self):
    2626        self.client.logout()
    2727
    28     def testBasicAddGet(self):
     28    def test_basic_add_GET(self):
    2929        """
    3030        Ensure GET on the add_view works.
    3131        """
    class AdminCustomUrlsTest(TestCase): 
    3333        self.assertIsInstance(response, TemplateResponse)
    3434        self.assertEqual(response.status_code, 200)
    3535
    36     def testAddWithGETArgs(self):
     36    def test_add_with_GET_args(self):
    3737        """
    3838        Ensure GET on the add_view plus specifying a field value in the query
    3939        string works.
    class AdminCustomUrlsTest(TestCase): 
    4242        self.assertEqual(response.status_code, 200)
    4343        self.assertContains(response, 'value="My Action"')
    4444
    45     def testBasicAddPost(self):
     45    def test_basic_add_POST(self):
    4646        """
    4747        Ensure POST on add_view works.
    4848        """
    class AdminCustomUrlsTest(TestCase): 
    5656        self.assertContains(response, 'dismissAddAnotherPopup')
    5757        self.assertContains(response, 'Action added through a popup')
    5858
    59     def testAdminUrlsNoClash(self):
     59    def test_admin_URLs_no_clash(self):
    6060        """
    6161        Test that some admin URLs work correctly.
    6262        """
  • tests/admin_views/tests.py

    -- 
    1.9.1
    
    
    From b18def65987d7c4903ad00f84b1b42780b09a8d2 Mon Sep 17 00:00:00 2001
    From: Brylie Christopher Oxley <brylie@gnumedia.org>
    Date: Mon, 30 Jun 2014 13:07:36 +0300
    Subject: [PATCH 02/12] Changed camel case test names.
    
    ---
     tests/admin_views/tests.py | 152 ++++++++++++++++++++++-----------------------
     1 file changed, 76 insertions(+), 76 deletions(-)
    
    diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
    index f1d2dab..32c1883 100644
    a b class AdminViewBasicTestCase(TestCase): 
    9292
    9393
    9494class AdminViewBasicTest(AdminViewBasicTestCase):
    95     def testTrailingSlashRequired(self):
     95    def test_trailing_slash_required(self):
    9696        """
    9797        If you leave off the trailing slash, app should redirect and add it.
    9898        """
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    101101            '/test_admin/%s/admin_views/article/add/' % self.urlbit,
    102102            status_code=301)
    103103
    104     def testBasicAddGet(self):
     104    def test_basic_add_GET(self):
    105105        """
    106106        A smoke test to ensure GET on the add_view works.
    107107        """
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    109109        self.assertIsInstance(response, TemplateResponse)
    110110        self.assertEqual(response.status_code, 200)
    111111
    112     def testAddWithGETArgs(self):
     112    def test_add_with_GET_args(self):
    113113        response = self.client.get('/test_admin/%s/admin_views/section/add/' % self.urlbit, {'name': 'My Section'})
    114114        self.assertEqual(response.status_code, 200)
    115115        self.assertContains(response, 'value="My Section"',
    116116            msg_prefix="Couldn't find an input with the right value in the response")
    117117
    118     def testBasicEditGet(self):
     118    def test_basic_edit_GET(self):
    119119        """
    120120        A smoke test to ensure GET on the change_view works.
    121121        """
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    123123        self.assertIsInstance(response, TemplateResponse)
    124124        self.assertEqual(response.status_code, 200)
    125125
    126     def testBasicEditGetStringPK(self):
     126    def test_basic_edit_GET_string_PK(self):
    127127        """
    128128        Ensure GET on the change_view works (returns an HTTP 404 error, see
    129129        #11191) when passing a string as the PK argument for a model with an
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    132132        response = self.client.get('/test_admin/%s/admin_views/section/abc/' % self.urlbit)
    133133        self.assertEqual(response.status_code, 404)
    134134
    135     def testBasicInheritanceGetStringPK(self):
     135    def test_basic_inheritance_GET_string_PK(self):
    136136        """
    137137        Ensure GET on the change_view works on inherited models (returns an
    138138        HTTP 404 error, see #19951) when passing a string as the PK argument
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    141141        response = self.client.get('/test_admin/%s/admin_views/supervillain/abc/' % self.urlbit)
    142142        self.assertEqual(response.status_code, 404)
    143143
    144     def testBasicAddPost(self):
     144    def test_basic_add_POST(self):
    145145        """
    146146        A smoke test to ensure POST on add_view works.
    147147        """
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    155155        response = self.client.post('/test_admin/%s/admin_views/section/add/' % self.urlbit, post_data)
    156156        self.assertEqual(response.status_code, 302)  # redirect somewhere
    157157
    158     def testPopupAddPost(self):
     158    def test_popup_add_POST(self):
    159159        """
    160160        Ensure http response from a popup is properly escaped.
    161161        """
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    212212        "article_set-5-date_1": "",
    213213    }
    214214
    215     def testBasicEditPost(self):
     215    def test_basic_edit_POST(self):
    216216        """
    217217        A smoke test to ensure POST on edit_view works.
    218218        """
    219219        response = self.client.post('/test_admin/%s/admin_views/section/1/' % self.urlbit, self.inline_post_data)
    220220        self.assertEqual(response.status_code, 302)  # redirect somewhere
    221221
    222     def testEditSaveAs(self):
     222    def test_edit_save_as(self):
    223223        """
    224224        Test "save as".
    225225        """
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    235235        response = self.client.post('/test_admin/%s/admin_views/section/1/' % self.urlbit, post_data)
    236236        self.assertEqual(response.status_code, 302)  # redirect somewhere
    237237
    238     def testChangeListSortingCallable(self):
     238    def test_change_list_sorting_callable(self):
    239239        """
    240240        Ensure we can sort on a list_display field that is a callable
    241241        (column 2 is callable_year in ArticleAdmin)
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    246246        self.assertContentBefore(response, 'Middle content', 'Newest content',
    247247            "Results of sorting on callable are out of order.")
    248248
    249     def testChangeListSortingModel(self):
     249    def test_change_list_sorting_model(self):
    250250        """
    251251        Ensure we can sort on a list_display field that is a Model method
    252252        (column 3 is 'model_year' in ArticleAdmin)
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    257257        self.assertContentBefore(response, 'Middle content', 'Oldest content',
    258258            "Results of sorting on Model method are out of order.")
    259259
    260     def testChangeListSortingModelAdmin(self):
     260    def test_change_list_sorting_model_admin(self):
    261261        """
    262262        Ensure we can sort on a list_display field that is a ModelAdmin method
    263263        (column 4 is 'modeladmin_year' in ArticleAdmin)
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    268268        self.assertContentBefore(response, 'Middle content', 'Newest content',
    269269            "Results of sorting on ModelAdmin method are out of order.")
    270270
    271     def testChangeListSortingModelAdminReverse(self):
     271    def test_change_list_sorting_model_admin_reverse(self):
    272272        """
    273273        Ensure we can sort on a list_display field that is a ModelAdmin
    274274        method in reverse order (i.e. admin_order_field uses the '-' prefix)
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    287287        self.assertContentBefore(response, '2008', '2009',
    288288            "Results of sorting on ModelAdmin method are out of order.")
    289289
    290     def testChangeListSortingMultiple(self):
     290    def test_change_list_sorting_multiple(self):
    291291        p1 = Person.objects.create(name="Chris", gender=1, alive=True)
    292292        p2 = Person.objects.create(name="Chris", gender=2, alive=True)
    293293        p3 = Person.objects.create(name="Bob", gender=1, alive=True)
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    307307        self.assertContentBefore(response, link2, link3)
    308308        self.assertContentBefore(response, link3, link1)
    309309
    310     def testChangeListSortingPreserveQuerySetOrdering(self):
     310    def test_change_list_sorting_preserve_query_set_ordering(self):
    311311        """
    312312        If no ordering is defined in `ModelAdmin.ordering` or in the query
    313313        string, then the underlying order of the queryset should not be
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    327327        self.assertContentBefore(response, link3, link2)
    328328        self.assertContentBefore(response, link2, link1)
    329329
    330     def testChangeListSortingModelMeta(self):
     330    def test_change_list_sorting_model_meta(self):
    331331        # Test ordering on Model Meta is respected
    332332
    333333        l1 = Language.objects.create(iso='ur', name='Urdu')
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    342342        response = self.client.get('/test_admin/admin/admin_views/language/', {'o': '-1'})
    343343        self.assertContentBefore(response, link1, link2)
    344344
    345     def testChangeListSortingOverrideModelAdmin(self):
     345    def test_change_list_sorting_override_model_admin(self):
    346346        # Test ordering on Model Admin is respected, and overrides Model Meta
    347347        dt = datetime.datetime.now()
    348348        p1 = Podcast.objects.create(name="A", release_date=dt)
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    353353        response = self.client.get('/test_admin/admin/admin_views/podcast/', {})
    354354        self.assertContentBefore(response, link1, link2)
    355355
    356     def testMultipleSortSameField(self):
     356    def test_multiple_sort_same_field(self):
    357357        # Check that we get the columns we expect if we have two columns
    358358        # that correspond to the same ordering field
    359359        dt = datetime.datetime.now()
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    383383        # Check sorting - should be by name
    384384        self.assertContentBefore(response, link2, link1)
    385385
    386     def testSortIndicatorsAdminOrder(self):
     386    def test_sort_indicators_admin_order(self):
    387387        """
    388388        Ensures that the admin shows default sort indicators for all
    389389        kinds of 'ordering' fields: field names, method on the model
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    409409            self.assertContentBefore(response, 'The First Item', 'The Middle Item')
    410410            self.assertContentBefore(response, 'The Middle Item', 'The Last Item')
    411411
    412     def testLimitedFilter(self):
     412    def test_limited_filter(self):
    413413        """Ensure admin changelist filters do not contain objects excluded via limit_choices_to.
    414414        This also tests relation-spanning filters (e.g. 'color__value').
    415415        """
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    420420        self.assertNotContains(response, '<a href="?color__id__exact=3">Blue</a>',
    421421            msg_prefix="Changelist filter not correctly limited by limit_choices_to")
    422422
    423     def testRelationSpanningFilters(self):
     423    def test_relation_spanning_filters(self):
    424424        response = self.client.get('/test_admin/%s/admin_views/chapterxtra1/' %
    425425                                   self.urlbit)
    426426        self.assertEqual(response.status_code, 200)
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    459459                for obj in filtered_response.context['cl'].queryset.all():
    460460                    self.assertTrue(params['test'](obj, value))
    461461
    462     def testIncorrectLookupParameters(self):
     462    def test_incorrect_lookup_parameters(self):
    463463        """Ensure incorrect lookup parameters are handled gracefully."""
    464464        response = self.client.get('/test_admin/%s/admin_views/thing/' % self.urlbit, {'notarealfield': '5'})
    465465        self.assertRedirects(response, '/test_admin/%s/admin_views/thing/?e=1' % self.urlbit)
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    475475        response = self.client.get('/test_admin/%s/admin_views/thing/' % self.urlbit, {'pub_date__gte': 'foo'})
    476476        self.assertRedirects(response, '/test_admin/%s/admin_views/thing/?e=1' % self.urlbit)
    477477
    478     def testIsNullLookups(self):
     478    def test_is_null_lookups(self):
    479479        """Ensure is_null is handled correctly."""
    480480        Article.objects.create(title="I Could Go Anywhere", content="Versatile", date=datetime.datetime.now())
    481481        response = self.client.get('/test_admin/%s/admin_views/article/' % self.urlbit)
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    489489        response = self.client.get('/test_admin/%s/admin_views/article/' % self.urlbit, {'section__isnull': '1'})
    490490        self.assertContains(response, '1 article')
    491491
    492     def testLogoutAndPasswordChangeURLs(self):
     492    def test_logout_and_password_change_URLs(self):
    493493        response = self.client.get('/test_admin/%s/admin_views/article/' % self.urlbit)
    494494        self.assertContains(response, '<a href="/test_admin/%s/logout/">' % self.urlbit)
    495495        self.assertContains(response, '<a href="/test_admin/%s/password_change/">' % self.urlbit)
    496496
    497     def testNamedGroupFieldChoicesChangeList(self):
     497    def test_named_group_field_choices_change_list(self):
    498498        """
    499499        Ensures the admin changelist shows correct values in the relevant column
    500500        for rows corresponding to instances of a model in which a named group
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    507507        self.assertContains(response, '<a href="%s">Horizontal</a>' % link1, msg_prefix=fail_msg, html=True)
    508508        self.assertContains(response, '<a href="%s">Vertical</a>' % link2, msg_prefix=fail_msg, html=True)
    509509
    510     def testNamedGroupFieldChoicesFilter(self):
     510    def test_named_group_field_choices_filter(self):
    511511        """
    512512        Ensures the filter UI shows correctly when at least one named group has
    513513        been used in the choices option of a model field.
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    520520        self.assertContains(response,
    521521            '<a href="?surface__exact=y">Vertical</a>', msg_prefix=fail_msg, html=True)
    522522
    523     def testChangeListNullBooleanDisplay(self):
     523    def test_change_list_null_boolean_display(self):
    524524        Post.objects.create(public=None)
    525525        # This hard-codes the URl because it'll fail if it runs
    526526        # against the 'admin2' custom admin (which doesn't have the
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    528528        response = self.client.get("/test_admin/admin/admin_views/post/")
    529529        self.assertContains(response, 'icon-unknown.gif')
    530530
    531     def testI18NLanguageNonEnglishDefault(self):
     531    def test_i18n_language_non_english_default(self):
    532532        """
    533533        Check if the JavaScript i18n view returns an empty language catalog
    534534        if the default language is non-English but the selected language
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    538538            response = self.client.get('/test_admin/admin/jsi18n/')
    539539            self.assertNotContains(response, 'Choisir une heure')
    540540
    541     def testI18NLanguageNonEnglishFallback(self):
     541    def test_i18n_language_non_english_fallback(self):
    542542        """
    543543        Makes sure that the fallback language is still working properly
    544544        in cases where the selected language cannot be found.
    class AdminViewBasicTest(AdminViewBasicTestCase): 
    547547            response = self.client.get('/test_admin/admin/jsi18n/')
    548548            self.assertContains(response, 'Choisir une heure')
    549549
    550     def testL10NDeactivated(self):
     550    def test_L10N_deactivated(self):
    551551        """
    552552        Check if L10N is deactivated, the JavaScript i18n view doesn't
    553553        return localized date/time formats. Refs #14824.
    class AdminViewFormUrlTest(TestCase): 
    789789    def tearDown(self):
    790790        self.client.logout()
    791791
    792     def testChangeFormUrlHasCorrectValue(self):
     792    def test_change_form_URL_has_correct_value(self):
    793793        """
    794794        Tests whether change_view has form_url in response.context
    795795        """
    class AdminViewFormUrlTest(TestCase): 
    797797        self.assertTrue('form_url' in response.context, msg='form_url not present in response.context')
    798798        self.assertEqual(response.context['form_url'], 'pony')
    799799
    800     def testInitialDataCanBeOverridden(self):
     800    def test_initial_data_can_be_overridden(self):
    801801        """
    802802        Tests that the behavior for setting initial
    803803        form data can be overridden in the ModelAdmin class.
    class SaveAsTests(TestCase): 
    891891class CustomModelAdminTest(AdminViewBasicTestCase):
    892892    urlbit = "admin2"
    893893
    894     def testCustomAdminSiteLoginForm(self):
     894    def test_custom_admin_site_login_form(self):
    895895        self.client.logout()
    896896        response = self.client.get('/test_admin/admin2/', follow=True)
    897897        self.assertIsInstance(response, TemplateResponse)
    class CustomModelAdminTest(AdminViewBasicTestCase): 
    905905        self.assertEqual(login.status_code, 200)
    906906        self.assertContains(login, 'custom form error')
    907907
    908     def testCustomAdminSiteLoginTemplate(self):
     908    def test_custom_admin_site_login_template(self):
    909909        self.client.logout()
    910910        response = self.client.get('/test_admin/admin2/', follow=True)
    911911        self.assertIsInstance(response, TemplateResponse)
    912912        self.assertTemplateUsed(response, 'custom_admin/login.html')
    913913        self.assertContains(response, 'Hello from a custom login template')
    914914
    915     def testCustomAdminSiteLogoutTemplate(self):
     915    def test_custom_admin_site_logout_template(self):
    916916        response = self.client.get('/test_admin/admin2/logout/')
    917917        self.assertIsInstance(response, TemplateResponse)
    918918        self.assertTemplateUsed(response, 'custom_admin/logout.html')
    919919        self.assertContains(response, 'Hello from a custom logout template')
    920920
    921     def testCustomAdminSiteIndexViewAndTemplate(self):
     921    def test_custom_admin_site_index_view_and_template(self):
    922922        try:
    923923            response = self.client.get('/test_admin/admin2/')
    924924        except TypeError:
    class CustomModelAdminTest(AdminViewBasicTestCase): 
    927927        self.assertTemplateUsed(response, 'custom_admin/index.html')
    928928        self.assertContains(response, 'Hello from a custom index template *bar*')
    929929
    930     def testCustomAdminSiteAppIndexViewandTemplate(self):
     930    def test_custom_admin_site_app_index_view_and_template(self):
    931931        response = self.client.get('/test_admin/admin2/admin_views/')
    932932        self.assertIsInstance(response, TemplateResponse)
    933933        self.assertTemplateUsed(response, 'custom_admin/app_index.html')
    934934        self.assertContains(response, 'Hello from a custom app_index template')
    935935
    936     def testCustomAdminSitePasswordChangeTemplate(self):
     936    def test_custom_admin_site_password_change_template(self):
    937937        response = self.client.get('/test_admin/admin2/password_change/')
    938938        self.assertIsInstance(response, TemplateResponse)
    939939        self.assertTemplateUsed(response, 'custom_admin/password_change_form.html')
    940940        self.assertContains(response, 'Hello from a custom password change form template')
    941941
    942     def testCustomAdminSitePasswordChangeDoneTemplate(self):
     942    def test_custom_admin_site_password_change_done_template(self):
    943943        response = self.client.get('/test_admin/admin2/password_change/done/')
    944944        self.assertIsInstance(response, TemplateResponse)
    945945        self.assertTemplateUsed(response, 'custom_admin/password_change_done.html')
    946946        self.assertContains(response, 'Hello from a custom password change done template')
    947947
    948     def testCustomAdminSiteView(self):
     948    def test_custom_admin_site_view(self):
    949949        self.client.login(username='super', password='secret')
    950950        response = self.client.get('/test_admin/%s/my_view/' % self.urlbit)
    951951        self.assertEqual(response.content, b"Django is a magical pony!")
    class AdminViewPermissionsTest(TestCase): 
    10401040            'password': 'secret',
    10411041        }
    10421042
    1043     def testLogin(self):
     1043    def test_login(self):
    10441044        """
    10451045        Make sure only staff members can log in.
    10461046
    class AdminViewPermissionsTest(TestCase): 
    11101110        form = login.context[0].get('form')
    11111111        self.assertEqual(form.errors['username'][0], 'This field is required.')
    11121112
    1113     def testLoginSuccessfullyRedirectsToOriginalUrl(self):
     1113    def test_login_successfully_redirects_to_original_URL(self):
    11141114        response = self.client.get('/test_admin/admin/')
    11151115        self.assertEqual(response.status_code, 302)
    11161116        query_string = 'the-answer=42'
    class AdminViewPermissionsTest(TestCase): 
    11231123            post_data)
    11241124        self.assertRedirects(login, redirect_url)
    11251125
    1126     def testDoubleLoginIsNotAllowed(self):
     1126    def test_double_login_is_not_allowed(self):
    11271127        """Regression test for #19327"""
    11281128        login_url = reverse('admin:login') + '?next=/test_admin/admin/'
    11291129
    class AdminViewPermissionsTest(TestCase): 
    11511151        self.assertFalse(login.context)
    11521152        self.client.get('/test_admin/admin/logout/')
    11531153
    1154     def testAddView(self):
     1154    def test_add_view(self):
    11551155        """Test add view restricts access and actually adds items."""
    11561156
    11571157        login_url = reverse('admin:login') + '?next=/test_admin/admin/'
    class AdminViewPermissionsTest(TestCase): 
    12071207        # make sure the view removes test cookie
    12081208        self.assertEqual(self.client.session.test_cookie_worked(), False)
    12091209
    1210     def testChangeView(self):
     1210    def test_change_view(self):
    12111211        """Change view should restrict access and allow users to edit items."""
    12121212
    12131213        login_url = reverse('admin:login') + '?next=/test_admin/admin/'
    class AdminViewPermissionsTest(TestCase): 
    12851285            self.assertContains(response, 'login-form')
    12861286            self.client.get('/test_admin/admin/logout/')
    12871287
    1288     def testHistoryView(self):
     1288    def test_history_view(self):
    12891289        """History view should restrict access."""
    12901290
    12911291        login_url = reverse('admin:login') + '?next=/test_admin/admin/'
    class AdminViewPermissionsTest(TestCase): 
    13271327
    13281328            self.client.get('/test_admin/admin/logout/')
    13291329
    1330     def testConditionallyShowAddSectionLink(self):
     1330    def test_conditionally_show_add_section_link(self):
    13311331        """
    13321332        The foreign key widget should only show the "add related" button if the
    13331333        user has permission to add that related item.
    class AdminViewPermissionsTest(TestCase): 
    13501350        response = self.client.get(url)
    13511351        self.assertContains(response, add_link_text)
    13521352
    1353     def testCustomModelAdminTemplates(self):
     1353    def test_custom_model_admin_templates(self):
    13541354        login_url = reverse('admin:login') + '?next=/test_admin/admin/'
    13551355        self.client.get('/test_admin/admin/')
    13561356        self.client.post(login_url, self.super_login)
    class AdminViewPermissionsTest(TestCase): 
    13911391
    13921392        self.client.get('/test_admin/admin/logout/')
    13931393
    1394     def testDeleteView(self):
     1394    def test_delete_view(self):
    13951395        """Delete view should restrict access and actually delete items."""
    13961396
    13971397        login_url = reverse('admin:login') + '?next=/test_admin/admin/'
    class AdminViewPermissionsTest(TestCase): 
    14261426        self.assertEqual(logged.object_id, '1')
    14271427        self.client.get('/test_admin/admin/logout/')
    14281428
    1429     def testDisabledPermissionsWhenLoggedIn(self):
     1429    def test_disabled_permissions_when_logged_in(self):
    14301430        self.client.login(username='super', password='secret')
    14311431        superuser = User.objects.get(username='super')
    14321432        superuser.is_active = False
    class AdminViewPermissionsTest(TestCase): 
    14391439        response = self.client.get('/test_admin/admin/secure-view/', follow=True)
    14401440        self.assertContains(response, 'id="login-form"')
    14411441
    1442     def testDisabledStaffPermissionsWhenLoggedIn(self):
     1442    def test_disabled_staff_permissions_when_logged_in(self):
    14431443        self.client.login(username='super', password='secret')
    14441444        superuser = User.objects.get(username='super')
    14451445        superuser.is_staff = False
    class AdminViewPermissionsTest(TestCase): 
    14521452        response = self.client.get('/test_admin/admin/secure-view/', follow=True)
    14531453        self.assertContains(response, 'id="login-form"')
    14541454
    1455     def testAppIndexFailEarly(self):
     1455    def test_app_index_fail_early(self):
    14561456        """
    14571457        If a user has no module perms, avoid iterating over all the modeladmins
    14581458        in the registry.
    class AdminViewUnicodeTest(TestCase): 
    19011901    def tearDown(self):
    19021902        self.client.logout()
    19031903
    1904     def testUnicodeEdit(self):
     1904    def test_unicode_edit(self):
    19051905        """
    19061906        A test to ensure that POST on edit_view handles non-ASCII characters.
    19071907        """
    class AdminViewUnicodeTest(TestCase): 
    19341934        response = self.client.post('/test_admin/admin/admin_views/book/1/', post_data)
    19351935        self.assertEqual(response.status_code, 302)  # redirect somewhere
    19361936
    1937     def testUnicodeDelete(self):
     1937    def test_unicode_delete(self):
    19381938        """
    19391939        Ensure that the delete_view handles non-ASCII characters
    19401940        """
    class AdminInheritedInlinesTest(TestCase): 
    24042404    def tearDown(self):
    24052405        self.client.logout()
    24062406
    2407     def testInline(self):
     2407    def test_inline(self):
    24082408        "Ensure that inline models which inherit from a common parent are correctly handled by admin."
    24092409
    24102410        foo_user = "foo username"
    class AdminActionsTest(TestCase): 
    25632563        self.assertContains(response, '<li>Answer: <a href="/test_admin/admin/admin_views/answer/%s/">Because.</a></li>' % a1.pk, html=True)
    25642564        self.assertContains(response, '<li>Answer: <a href="/test_admin/admin/admin_views/answer/%s/">Yes.</a></li>' % a2.pk, html=True)
    25652565
    2566     def test_model_admin_default_delete_action_no_change_url(self):
     2566    def test_model_admin_default_delete_action_no_change_URL(self):
    25672567        """
    25682568        Default delete action shouldn't break if a user's ModelAdmin removes the url for change_view.
    25692569
    class TestInlineNotEditable(TestCase): 
    27912791    def tearDown(self):
    27922792        self.client.logout()
    27932793
    2794     def test(self):
     2794    def test_GET_parent_add(self):
    27952795        """
    27962796        InlineModelAdmin broken?
    27972797        """
    class NeverCacheTests(TestCase): 
    34213421    def tearDown(self):
    34223422        self.client.logout()
    34233423
    3424     def testAdminIndex(self):
     3424    def test_admin_index(self):
    34253425        "Check the never-cache status of the main index"
    34263426        response = self.client.get('/test_admin/admin/')
    34273427        self.assertEqual(get_max_age(response), 0)
    34283428
    3429     def testAppIndex(self):
     3429    def test_app_index(self):
    34303430        "Check the never-cache status of an application index"
    34313431        response = self.client.get('/test_admin/admin/admin_views/')
    34323432        self.assertEqual(get_max_age(response), 0)
    34333433
    3434     def testModelIndex(self):
     3434    def test_model_index(self):
    34353435        "Check the never-cache status of a model index"
    34363436        response = self.client.get('/test_admin/admin/admin_views/fabric/')
    34373437        self.assertEqual(get_max_age(response), 0)
    34383438
    3439     def testModelAdd(self):
     3439    def test_model_add(self):
    34403440        "Check the never-cache status of a model add page"
    34413441        response = self.client.get('/test_admin/admin/admin_views/fabric/add/')
    34423442        self.assertEqual(get_max_age(response), 0)
    34433443
    3444     def testModelView(self):
     3444    def test_model_view(self):
    34453445        "Check the never-cache status of a model edit page"
    34463446        response = self.client.get('/test_admin/admin/admin_views/section/1/')
    34473447        self.assertEqual(get_max_age(response), 0)
    34483448
    3449     def testModelHistory(self):
     3449    def test_model_history(self):
    34503450        "Check the never-cache status of a model history page"
    34513451        response = self.client.get('/test_admin/admin/admin_views/section/1/history/')
    34523452        self.assertEqual(get_max_age(response), 0)
    34533453
    3454     def testModelDelete(self):
     3454    def test_model_delete(self):
    34553455        "Check the never-cache status of a model delete page"
    34563456        response = self.client.get('/test_admin/admin/admin_views/section/1/delete/')
    34573457        self.assertEqual(get_max_age(response), 0)
    34583458
    3459     def testLogin(self):
     3459    def test_login(self):
    34603460        "Check the never-cache status of login views"
    34613461        self.client.logout()
    34623462        response = self.client.get('/test_admin/admin/')
    34633463        self.assertEqual(get_max_age(response), 0)
    34643464
    3465     def testLogout(self):
     3465    def test_logout(self):
    34663466        "Check the never-cache status of logout view"
    34673467        response = self.client.get('/test_admin/admin/logout/')
    34683468        self.assertEqual(get_max_age(response), 0)
    34693469
    3470     def testPasswordChange(self):
     3470    def test_password_change(self):
    34713471        "Check the never-cache status of the password change view"
    34723472        self.client.logout()
    34733473        response = self.client.get('/test_admin/password_change/')
    34743474        self.assertEqual(get_max_age(response), None)
    34753475
    3476     def testPasswordChangeDone(self):
     3476    def test_password_change_done(self):
    34773477        "Check the never-cache status of the password change done view"
    34783478        response = self.client.get('/test_admin/admin/password_change/done/')
    34793479        self.assertEqual(get_max_age(response), None)
    34803480
    3481     def testJsi18n(self):
     3481    def test_JS_i18n(self):
    34823482        "Check the never-cache status of the JavaScript i18n view"
    34833483        response = self.client.get('/test_admin/admin/jsi18n/')
    34843484        self.assertEqual(get_max_age(response), None)
    class CSSTest(TestCase): 
    41164116        self.assertContains(response, '<tr class="model-actor">')
    41174117        self.assertContains(response, '<tr class="model-album">')
    41184118
    4119     def testAppModelInFormBodyClass(self):
     4119    def test_app_model_in_form_body_class(self):
    41204120        """
    41214121        Ensure app and model tag are correctly read by change_form template
    41224122        """
    class CSSTest(TestCase): 
    41254125        self.assertContains(response,
    41264126            '<body class=" app-admin_views model-section ')
    41274127
    4128     def testAppModelInListBodyClass(self):
     4128    def test_app_model_in_list_body_class(self):
    41294129        """
    41304130        Ensure app and model tag are correctly read by change_list template
    41314131        """
    class CSSTest(TestCase): 
    41344134        self.assertContains(response,
    41354135            '<body class=" app-admin_views model-section ')
    41364136
    4137     def testAppModelInDeleteConfirmationBodyClass(self):
     4137    def test_app_model_in_delete_confirmation_body_class(self):
    41384138        """
    41394139        Ensure app and model tag are correctly read by delete_confirmation
    41404140        template
    class CSSTest(TestCase): 
    41454145        self.assertContains(response,
    41464146            '<body class=" app-admin_views model-section ')
    41474147
    4148     def testAppModelInAppIndexBodyClass(self):
     4148    def test_app_model_in_app_index_body_class(self):
    41494149        """
    41504150        Ensure app and model tag are correctly read by app_index template
    41514151        """
    class CSSTest(TestCase): 
    41534153        self.assertEqual(response.status_code, 200)
    41544154        self.assertContains(response, '<body class=" dashboard app-admin_views')
    41554155
    4156     def testAppModelInDeleteSelectedConfirmationBodyClass(self):
     4156    def test_app_model_in_delete_selected_confirmation_body_class(self):
    41574157        """
    41584158        Ensure app and model tag are correctly read by
    41594159        delete_selected_confirmation template
    class ValidXHTMLTests(TestCase): 
    42544254            global_settings.TEMPLATE_CONTEXT_PROCESSORS),
    42554255        USE_I18N=False,
    42564256    )
    4257     def testLangNamePresent(self):
     4257    def test_lang_name_present(self):
    42584258        response = self.client.get('/test_admin/%s/admin_views/' % self.urlbit)
    42594259        self.assertNotContains(response, ' lang=""')
    42604260        self.assertNotContains(response, ' xml:lang=""')
  • tests/admin_widgets/tests.py

    -- 
    1.9.1
    
    
    From 0970cf6149b3f630a0c029b5decb904c5b3aab58 Mon Sep 17 00:00:00 2001
    From: Brylie Christopher Oxley <brylie@gnumedia.org>
    Date: Mon, 30 Jun 2014 15:57:47 +0300
    Subject: [PATCH 03/12] Modified camel case test names.
    
    ---
     tests/admin_widgets/tests.py | 52 ++++++++++++++++++++++----------------------
     1 file changed, 26 insertions(+), 26 deletions(-)
    
    diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py
    index 39f89f6..fb055da 100644
    a b class AdminFormfieldForDBFieldTests(TestCase): 
    7171        # Return the formfield so that other tests can continue
    7272        return ff
    7373
    74     def testDateField(self):
     74    def test_DateField(self):
    7575        self.assertFormfield(models.Event, 'start_date', widgets.AdminDateWidget)
    7676
    77     def testDateTimeField(self):
     77    def test_DateTimeField(self):
    7878        self.assertFormfield(models.Member, 'birthdate', widgets.AdminSplitDateTime)
    7979
    80     def testTimeField(self):
     80    def test_TimeField(self):
    8181        self.assertFormfield(models.Event, 'start_time', widgets.AdminTimeWidget)
    8282
    83     def testTextField(self):
     83    def test_TextField(self):
    8484        self.assertFormfield(models.Event, 'description', widgets.AdminTextareaWidget)
    8585
    86     def testURLField(self):
     86    def test_URLField(self):
    8787        self.assertFormfield(models.Event, 'link', widgets.AdminURLFieldWidget)
    8888
    89     def testIntegerField(self):
     89    def test_IntegerField(self):
    9090        self.assertFormfield(models.Event, 'min_age', widgets.AdminIntegerFieldWidget)
    9191
    92     def testCharField(self):
     92    def test_CharField(self):
    9393        self.assertFormfield(models.Member, 'name', widgets.AdminTextInputWidget)
    9494
    95     def testEmailField(self):
     95    def test_EmailField(self):
    9696        self.assertFormfield(models.Member, 'email', widgets.AdminEmailInputWidget)
    9797
    98     def testFileField(self):
     98    def test_FileField(self):
    9999        self.assertFormfield(models.Album, 'cover_art', widgets.AdminFileWidget)
    100100
    101     def testForeignKey(self):
     101    def test_ForeignKey(self):
    102102        self.assertFormfield(models.Event, 'main_band', forms.Select)
    103103
    104     def testRawIDForeignKey(self):
     104    def test_raw_ID_ForeignKey(self):
    105105        self.assertFormfield(models.Event, 'main_band', widgets.ForeignKeyRawIdWidget,
    106106                             raw_id_fields=['main_band'])
    107107
    108     def testRadioFieldsForeignKey(self):
     108    def test_radio_fields_ForeignKey(self):
    109109        ff = self.assertFormfield(models.Event, 'main_band', widgets.AdminRadioSelect,
    110110                                  radio_fields={'main_band': admin.VERTICAL})
    111111        self.assertEqual(ff.empty_label, None)
    112112
    113     def testManyToMany(self):
     113    def test_many_to_many(self):
    114114        self.assertFormfield(models.Band, 'members', forms.SelectMultiple)
    115115
    116     def testRawIDManyTOMany(self):
     116    def test_raw_ID_many_to_many(self):
    117117        self.assertFormfield(models.Band, 'members', widgets.ManyToManyRawIdWidget,
    118118                             raw_id_fields=['members'])
    119119
    120     def testFilteredManyToMany(self):
     120    def test_filtered_many_to_many(self):
    121121        self.assertFormfield(models.Band, 'members', widgets.FilteredSelectMultiple,
    122122                             filter_vertical=['members'])
    123123
    124     def testFormfieldOverrides(self):
     124    def test_formfield_overrides(self):
    125125        self.assertFormfield(models.Event, 'start_date', forms.TextInput,
    126126                             formfield_overrides={DateField: {'widget': forms.TextInput}})
    127127
    128     def testFormfieldOverridesWidgetInstances(self):
     128    def test_formfield_overrides_widget_instances(self):
    129129        """
    130130        Test that widget instances in formfield_overrides are not shared between
    131131        different fields. (#19423)
    class AdminFormfieldForDBFieldTests(TestCase): 
    142142        self.assertEqual(f2.widget.attrs['maxlength'], '20')
    143143        self.assertEqual(f2.widget.attrs['size'], '10')
    144144
    145     def testFieldWithChoices(self):
     145    def test_field_with_choices(self):
    146146        self.assertFormfield(models.Member, 'gender', forms.Select)
    147147
    148     def testChoicesWithRadioFields(self):
     148    def test_choices_with_radio_fields(self):
    149149        self.assertFormfield(models.Member, 'gender', widgets.AdminRadioSelect,
    150150                             radio_fields={'gender': admin.VERTICAL})
    151151
    152     def testInheritance(self):
     152    def test_inheritance(self):
    153153        self.assertFormfield(models.Album, 'backside_art', widgets.AdminFileWidget)
    154154
    155155    def test_m2m_widgets(self):
    class AdminFormfieldForDBFieldTests(TestCase): 
    169169class AdminFormfieldForDBFieldWithRequestTests(DjangoTestCase):
    170170    fixtures = ["admin-widgets-users.xml"]
    171171
    172     def testFilterChoicesByRequestUser(self):
     172    def test_filter_choices_by_request_user(self):
    173173        """
    174174        Ensure the user can only see their own cars in the foreign key dropdown.
    175175        """
    class AdminForeignKeyWidgetChangeList(DjangoTestCase): 
    190190    def tearDown(self):
    191191        self.client.logout()
    192192
    193     def test_changelist_foreignkey(self):
     193    def test_changelist_ForeignKey(self):
    194194        response = self.client.get('/admin_widgets/car/')
    195195        self.assertContains(response, '/auth/user/add/')
    196196
    class ForeignKeyRawIdWidgetTest(DjangoTestCase): 
    411411            )
    412412        )
    413413
    414     def test_fk_related_model_not_in_admin(self):
     414    def test_FK_related_model_not_in_admin(self):
    415415        # FK to a model not registered with admin site. Raw ID widget should
    416416        # have no magnifying glass link. See #16542
    417417        big_honeycomb = models.Honeycomb.objects.create(location='Old tree')
    class ForeignKeyRawIdWidgetTest(DjangoTestCase): 
    424424            '<input type="text" name="honeycomb_widget" value="%(hcombpk)s" />&nbsp;<strong>Honeycomb object</strong>' % {'hcombpk': big_honeycomb.pk}
    425425        )
    426426
    427     def test_fk_to_self_model_not_in_admin(self):
     427    def test_FK_to_self_model_not_in_admin(self):
    428428        # FK to self, not registered with admin site. Raw ID widget should have
    429429        # no magnifying glass link. See #16542
    430430        subject1 = models.Individual.objects.create(name='Subject #1')
    class AdminRawIdWidgetSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase): 
    972972        models.Band.objects.create(id=98, name='Green Potatoes')
    973973        super(AdminRawIdWidgetSeleniumFirefoxTests, self).setUp()
    974974
    975     def test_foreignkey(self):
     975    def test_ForeignKey(self):
    976976        self.admin_login(username='super', password='secret', login_url='/')
    977977        self.selenium.get(
    978978            '%s%s' % (self.live_server_url, '/admin_widgets/event/add/'))
    class RelatedFieldWidgetSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase): 
    10581058    fixtures = ['admin-widgets-users.xml']
    10591059    webdriver_class = 'selenium.webdriver.firefox.webdriver.WebDriver'
    10601060
    1061     def test_foreign_key_using_to_field(self):
     1061    def test_ForeignKey_using_to_field(self):
    10621062        self.admin_login(username='super', password='secret', login_url='/')
    10631063        self.selenium.get('%s%s' % (
    10641064            self.live_server_url,
  • tests/bug639/tests.py

    -- 
    1.9.1
    
    
    From a5b81d91f6d65c5cbe5c5fcbd126bb840033696d Mon Sep 17 00:00:00 2001
    From: Brylie Christopher Oxley <brylie@gnumedia.org>
    Date: Mon, 30 Jun 2014 16:00:21 +0300
    Subject: [PATCH 04/12] Modified camel case test name.
    
    ---
     tests/bug639/tests.py | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/tests/bug639/tests.py b/tests/bug639/tests.py
    index 769d27d..26e172a 100644
    a b from .models import Photo, PhotoForm, temp_storage_dir 
    1616
    1717class Bug639Test(unittest.TestCase):
    1818
    19     def testBug639(self):
     19    def test_bug_639(self):
    2020        """
    2121        Simulate a file upload and check how many times Model.save() gets
    2222        called.
  • tests/conditional_processing/tests.py

    -- 
    1.9.1
    
    
    From 2a935773f8c16c42f5a77ee208d7ac8d8b9f7a71 Mon Sep 17 00:00:00 2001
    From: Brylie Christopher Oxley <brylie@gnumedia.org>
    Date: Mon, 30 Jun 2014 16:06:02 +0300
    Subject: [PATCH 05/12] Modified camel case test names.
    
    ---
     tests/conditional_processing/tests.py | 24 ++++++++++++------------
     1 file changed, 12 insertions(+), 12 deletions(-)
    
    diff --git a/tests/conditional_processing/tests.py b/tests/conditional_processing/tests.py
    index 162a405..934ca5c 100644
    a b class ConditionalGet(TestCase): 
    3131        self.assertEqual(response.status_code, 304)
    3232        self.assertEqual(response.content, b'')
    3333
    34     def testWithoutConditions(self):
     34    def test_without_conditions(self):
    3535        response = self.client.get('/condition/')
    3636        self.assertFullResponse(response)
    3737
    38     def testIfModifiedSince(self):
     38    def test_if_modified_since(self):
    3939        self.client.defaults['HTTP_IF_MODIFIED_SINCE'] = LAST_MODIFIED_STR
    4040        response = self.client.get('/condition/')
    4141        self.assertNotModified(response)
    class ConditionalGet(TestCase): 
    4949        response = self.client.get('/condition/')
    5050        self.assertFullResponse(response)
    5151
    52     def testIfNoneMatch(self):
     52    def test_if_none_match(self):
    5353        self.client.defaults['HTTP_IF_NONE_MATCH'] = '"%s"' % ETAG
    5454        response = self.client.get('/condition/')
    5555        self.assertNotModified(response)
    class ConditionalGet(TestCase): 
    6262        response = self.client.get('/condition/')
    6363        self.assertNotModified(response)
    6464
    65     def testIfMatch(self):
     65    def test_if_match(self):
    6666        self.client.defaults['HTTP_IF_MATCH'] = '"%s"' % ETAG
    6767        response = self.client.put('/condition/etag/')
    6868        self.assertEqual(response.status_code, 200)
    class ConditionalGet(TestCase): 
    7070        response = self.client.put('/condition/etag/')
    7171        self.assertEqual(response.status_code, 412)
    7272
    73     def testBothHeaders(self):
     73    def test_both_headers(self):
    7474        self.client.defaults['HTTP_IF_MODIFIED_SINCE'] = LAST_MODIFIED_STR
    7575        self.client.defaults['HTTP_IF_NONE_MATCH'] = '"%s"' % ETAG
    7676        response = self.client.get('/condition/')
    class ConditionalGet(TestCase): 
    8686        response = self.client.get('/condition/')
    8787        self.assertFullResponse(response)
    8888
    89     def testSingleCondition1(self):
     89    def test_single_condition_1(self):
    9090        self.client.defaults['HTTP_IF_MODIFIED_SINCE'] = LAST_MODIFIED_STR
    9191        response = self.client.get('/condition/last_modified/')
    9292        self.assertNotModified(response)
    9393        response = self.client.get('/condition/etag/')
    9494        self.assertFullResponse(response, check_last_modified=False)
    9595
    96     def testSingleCondition2(self):
     96    def test_single_condition_2(self):
    9797        self.client.defaults['HTTP_IF_NONE_MATCH'] = '"%s"' % ETAG
    9898        response = self.client.get('/condition/etag/')
    9999        self.assertNotModified(response)
    100100        response = self.client.get('/condition/last_modified/')
    101101        self.assertFullResponse(response, check_etag=False)
    102102
    103     def testSingleCondition3(self):
     103    def test_single_condition_3(self):
    104104        self.client.defaults['HTTP_IF_MODIFIED_SINCE'] = EXPIRED_LAST_MODIFIED_STR
    105105        response = self.client.get('/condition/last_modified/')
    106106        self.assertFullResponse(response, check_etag=False)
    107107
    108     def testSingleCondition4(self):
     108    def test_single_condition_4(self):
    109109        self.client.defaults['HTTP_IF_NONE_MATCH'] = '"%s"' % EXPIRED_ETAG
    110110        response = self.client.get('/condition/etag/')
    111111        self.assertFullResponse(response, check_last_modified=False)
    112112
    113     def testSingleCondition5(self):
     113    def test_single_condition_5(self):
    114114        self.client.defaults['HTTP_IF_MODIFIED_SINCE'] = LAST_MODIFIED_STR
    115115        response = self.client.get('/condition/last_modified2/')
    116116        self.assertNotModified(response)
    117117        response = self.client.get('/condition/etag2/')
    118118        self.assertFullResponse(response, check_last_modified=False)
    119119
    120     def testSingleCondition6(self):
     120    def test_single_condition_6(self):
    121121        self.client.defaults['HTTP_IF_NONE_MATCH'] = '"%s"' % ETAG
    122122        response = self.client.get('/condition/etag2/')
    123123        self.assertNotModified(response)
    124124        response = self.client.get('/condition/last_modified2/')
    125125        self.assertFullResponse(response, check_etag=False)
    126126
    127     def testInvalidETag(self):
     127    def test_invalid_etag(self):
    128128        self.client.defaults['HTTP_IF_NONE_MATCH'] = r'"\"'
    129129        response = self.client.get('/condition/etag/')
    130130        self.assertFullResponse(response, check_last_modified=False)
  • tests/dispatch/tests/test_dispatcher.py

    -- 
    1.9.1
    
    
    From 4931cff49cd56ba8deb705f848f9b1aafb17a516 Mon Sep 17 00:00:00 2001
    From: Brylie Christopher Oxley <brylie@gnumedia.org>
    Date: Mon, 30 Jun 2014 16:15:23 +0300
    Subject: [PATCH 06/12] Modified camel case test names.
    
    ---
     tests/dispatch/tests/test_dispatcher.py | 22 +++++++++++-----------
     1 file changed, 11 insertions(+), 11 deletions(-)
    
    diff --git a/tests/dispatch/tests/test_dispatcher.py b/tests/dispatch/tests/test_dispatcher.py
    index 1bfa48a..8153cc2 100644
    a b d_signal = Signal(providing_args=["val"], use_caching=True) 
    4545class DispatcherTests(unittest.TestCase):
    4646    """Test suite for dispatcher (barely started)"""
    4747
    48     def _testIsClean(self, signal):
     48    def test_is_clean(self, signal):
    4949        """Assert that everything has been cleaned up automatically"""
    5050        # Note that dead weakref cleanup happens as side effect of using
    5151        # the signal's receivers through the signals API. So, first do a
    class DispatcherTests(unittest.TestCase): 
    5353        self.assertFalse(signal.has_listeners())
    5454        self.assertEqual(signal.receivers, [])
    5555
    56     def testExact(self):
     56    def test_exact(self):
    5757        a_signal.connect(receiver_1_arg, sender=self)
    5858        expected = [(receiver_1_arg, "test")]
    5959        result = a_signal.send(sender=self, val="test")
    class DispatcherTests(unittest.TestCase): 
    6161        a_signal.disconnect(receiver_1_arg, sender=self)
    6262        self._testIsClean(a_signal)
    6363
    64     def testIgnoredSender(self):
     64    def test_ignored_sender(self):
    6565        a_signal.connect(receiver_1_arg)
    6666        expected = [(receiver_1_arg, "test")]
    6767        result = a_signal.send(sender=self, val="test")
    class DispatcherTests(unittest.TestCase): 
    6969        a_signal.disconnect(receiver_1_arg)
    7070        self._testIsClean(a_signal)
    7171
    72     def testGarbageCollected(self):
     72    def test_garbage_collected(self):
    7373        a = Callable()
    7474        a_signal.connect(a.a, sender=self)
    7575        expected = []
    class DispatcherTests(unittest.TestCase): 
    7979        self.assertEqual(result, expected)
    8080        self._testIsClean(a_signal)
    8181
    82     def testCachedGarbagedCollected(self):
     82    def test_cached_garbaged_collected(self):
    8383        """
    8484        Make sure signal caching sender receivers don't prevent garbage
    8585        collection of senders.
    class DispatcherTests(unittest.TestCase): 
    9797            # Disconnect after reference check since it flushes the tested cache.
    9898            d_signal.disconnect(receiver_1_arg)
    9999
    100     def testMultipleRegistration(self):
     100    def test_multiple_registration(self):
    101101        a = Callable()
    102102        a_signal.connect(a)
    103103        a_signal.connect(a)
    class DispatcherTests(unittest.TestCase): 
    113113        garbage_collect()
    114114        self._testIsClean(a_signal)
    115115
    116     def testUidRegistration(self):
     116    def test_uid_registration(self):
    117117        def uid_based_receiver_1(**kwargs):
    118118            pass
    119119
    class DispatcherTests(unittest.TestCase): 
    126126        a_signal.disconnect(dispatch_uid="uid")
    127127        self._testIsClean(a_signal)
    128128
    129     def testRobust(self):
     129    def test_robust(self):
    130130        """Test the sendRobust function"""
    131131        def fails(val, **kwargs):
    132132            raise ValueError('this')
    class DispatcherTests(unittest.TestCase): 
    140140        a_signal.disconnect(fails)
    141141        self._testIsClean(a_signal)
    142142
    143     def testDisconnection(self):
     143    def test_disconnection(self):
    144144        receiver_1 = Callable()
    145145        receiver_2 = Callable()
    146146        receiver_3 = Callable()
    class ReceiverTestCase(unittest.TestCase): 
    170170    Test suite for receiver.
    171171
    172172    """
    173     def testReceiverSingleSignal(self):
     173    def test_receiver_single_signal(self):
    174174        @receiver(a_signal)
    175175        def f(val, **kwargs):
    176176            self.state = val
    class ReceiverTestCase(unittest.TestCase): 
    178178        a_signal.send(sender=self, val=True)
    179179        self.assertTrue(self.state)
    180180
    181     def testReceiverSignalList(self):
     181    def test_receiver_signal_list(self):
    182182        @receiver([a_signal, b_signal, c_signal])
    183183        def f(val, **kwargs):
    184184            self.state.append(val)
  • tests/generic_inline_admin/tests.py

    -- 
    1.9.1
    
    
    From e81b0cd48c7fdde48a62ae3727fc45f128b4bed2 Mon Sep 17 00:00:00 2001
    From: Brylie Christopher Oxley <brylie@gnumedia.org>
    Date: Mon, 30 Jun 2014 16:25:11 +0300
    Subject: [PATCH 07/12] Modified camel case test names.
    
    ---
     tests/generic_inline_admin/tests.py | 20 ++++++++++----------
     1 file changed, 10 insertions(+), 10 deletions(-)
    
    diff --git a/tests/generic_inline_admin/tests.py b/tests/generic_inline_admin/tests.py
    index e73fc40..99459b9 100644
    a b class GenericAdminViewTest(TestCase): 
    4646    def tearDown(self):
    4747        self.client.logout()
    4848
    49     def testBasicAddGet(self):
     49    def test_basic_add_GET(self):
    5050        """
    5151        A smoke test to ensure GET on the add_view works.
    5252        """
    5353        response = self.client.get('/generic_inline_admin/admin/generic_inline_admin/episode/add/')
    5454        self.assertEqual(response.status_code, 200)
    5555
    56     def testBasicEditGet(self):
     56    def test_basic_edit_GET(self):
    5757        """
    5858        A smoke test to ensure GET on the change_view works.
    5959        """
    6060        response = self.client.get('/generic_inline_admin/admin/generic_inline_admin/episode/%d/' % self.episode_pk)
    6161        self.assertEqual(response.status_code, 200)
    6262
    63     def testBasicAddPost(self):
     63    def test_basic_add_POST(self):
    6464        """
    6565        A smoke test to ensure POST on add_view works.
    6666        """
    class GenericAdminViewTest(TestCase): 
    7474        response = self.client.post('/generic_inline_admin/admin/generic_inline_admin/episode/add/', post_data)
    7575        self.assertEqual(response.status_code, 302)  # redirect somewhere
    7676
    77     def testBasicEditPost(self):
     77    def test_basic_edit_POST(self):
    7878        """
    7979        A smoke test to ensure POST on edit_view works.
    8080        """
    class GenericAdminViewTest(TestCase): 
    9595        response = self.client.post(url, post_data)
    9696        self.assertEqual(response.status_code, 302)  # redirect somewhere
    9797
    98     def testGenericInlineFormset(self):
     98    def test_generic_inline_formset(self):
    9999        EpisodeMediaFormSet = generic_inlineformset_factory(Media, can_delete=False, exclude=['description', 'keywords'], extra=3)
    100100        e = Episode.objects.get(name='This Week in Django')
    101101
    class GenericAdminViewTest(TestCase): 
    119119        self.assertHTMLEqual(formset.forms[0].as_p(), '<p><label for="id_generic_inline_admin-media-content_type-object_id-0-url">Url:</label> <input id="id_generic_inline_admin-media-content_type-object_id-0-url" type="url" name="generic_inline_admin-media-content_type-object_id-0-url" value="http://example.com/logo.png" maxlength="200" /><input type="hidden" name="generic_inline_admin-media-content_type-object_id-0-id" value="%s" id="id_generic_inline_admin-media-content_type-object_id-0-id" /></p>' % self.png_media_pk)
    120120        self.assertHTMLEqual(formset.forms[1].as_p(), '<p><label for="id_generic_inline_admin-media-content_type-object_id-1-url">Url:</label> <input id="id_generic_inline_admin-media-content_type-object_id-1-url" type="url" name="generic_inline_admin-media-content_type-object_id-1-url" maxlength="200" /><input type="hidden" name="generic_inline_admin-media-content_type-object_id-1-id" id="id_generic_inline_admin-media-content_type-object_id-1-id" /></p>')
    121121
    122     def testGenericInlineFormsetFactory(self):
     122    def test_generic_inline_formset_factory(self):
    123123        # Regression test for #10522.
    124124        inline_formset = generic_inlineformset_factory(Media,
    125125            exclude=('url',))
    class GenericInlineAdminParametersTest(TestCase): 
    153153        Media.objects.create(content_object=e, url='http://example.com/podcast.mp3')
    154154        return e
    155155
    156     def testNoParam(self):
     156    def test_no_param(self):
    157157        """
    158158        With one initial form, extra (default) at 3, there should be 4 forms.
    159159        """
    class GenericInlineAdminParametersTest(TestCase): 
    163163        self.assertEqual(formset.total_form_count(), 4)
    164164        self.assertEqual(formset.initial_form_count(), 1)
    165165
    166     def testExtraParam(self):
     166    def test_extra_param(self):
    167167        """
    168168        With extra=0, there should be one form.
    169169        """
    class GenericInlineAdminParametersTest(TestCase): 
    202202        self.assertEqual(formset.total_form_count(), 2)
    203203        self.assertEqual(formset.initial_form_count(), 1)
    204204
    205     def testMinNumParam(self):
     205    def test_min_num_param(self):
    206206        """
    207207        With extra=3 and min_num=2, there should be five forms.
    208208        """
    class GenericInlineAdminWithUniqueTogetherTest(TestCase): 
    234234    def tearDown(self):
    235235        self.client.logout()
    236236
    237     def testAdd(self):
     237    def test_add(self):
    238238        category_id = Category.objects.create(name='male').pk
    239239        post_data = {
    240240            "name": "John Doe",
  • tests/model_fields/tests.py

    -- 
    1.9.1
    
    
    From 7051550346830a9ac58c192551900582ca93bf62 Mon Sep 17 00:00:00 2001
    From: Brylie Christopher Oxley <brylie@gnumedia.org>
    Date: Mon, 30 Jun 2014 16:42:19 +0300
    Subject: [PATCH 08/12] Added camel case field names in test names.
    
    ---
     tests/model_fields/tests.py | 60 ++++++++++++++++++++++-----------------------
     1 file changed, 30 insertions(+), 30 deletions(-)
    
    diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py
    index b33314b..b18d3b2 100644
    a b class BasicFieldTests(test.TestCase): 
    4242        form_field = model_field.formfield(show_hidden_initial=False)
    4343        self.assertFalse(form_field.show_hidden_initial)
    4444
    45     def test_nullbooleanfield_blank(self):
     45    def test_NullBooleanField_blank(self):
    4646        """
    4747        Regression test for #13071: NullBooleanField should not throw
    4848        a validation error when given a value of None.
    class ForeignKeyTests(test.TestCase): 
    170170        self.assertEqual(b.a, a)
    171171
    172172    @test.skipIfDBFeature('interprets_empty_strings_as_nulls')
    173     def test_empty_string_fk(self):
     173    def test_empty_string_FK(self):
    174174        """
    175175        Test that foreign key values to empty strings don't get converted
    176176        to None (#19299)
    class ForeignKeyTests(test.TestCase): 
    182182
    183183
    184184class DateTimeFieldTests(unittest.TestCase):
    185     def test_datetimefield_to_python_usecs(self):
     185    def test_DateTimeField_to_python_usecs(self):
    186186        """DateTimeField.to_python should support usecs"""
    187187        f = models.DateTimeField()
    188188        self.assertEqual(f.to_python('2001-01-02 03:04:05.000006'),
    class DateTimeFieldTests(unittest.TestCase): 
    190190        self.assertEqual(f.to_python('2001-01-02 03:04:05.999999'),
    191191                         datetime.datetime(2001, 1, 2, 3, 4, 5, 999999))
    192192
    193     def test_timefield_to_python_usecs(self):
     193    def test_TimeField_to_python_usecs(self):
    194194        """TimeField.to_python should support usecs"""
    195195        f = models.TimeField()
    196196        self.assertEqual(f.to_python('01:02:03.000004'),
    class DateTimeFieldTests(unittest.TestCase): 
    212212
    213213
    214214class BooleanFieldTests(unittest.TestCase):
    215     def _test_get_db_prep_lookup(self, f):
     215    def test_get_db_prep_lookup(self, f):
    216216        self.assertEqual(f.get_db_prep_lookup('exact', True, connection=connection), [True])
    217217        self.assertEqual(f.get_db_prep_lookup('exact', '1', connection=connection), [True])
    218218        self.assertEqual(f.get_db_prep_lookup('exact', 1, connection=connection), [True])
    class BooleanFieldTests(unittest.TestCase): 
    221221        self.assertEqual(f.get_db_prep_lookup('exact', 0, connection=connection), [False])
    222222        self.assertEqual(f.get_db_prep_lookup('exact', None, connection=connection), [None])
    223223
    224     def _test_to_python(self, f):
     224    def test_to_python(self, f):
    225225        self.assertTrue(f.to_python(1) is True)
    226226        self.assertTrue(f.to_python(0) is False)
    227227
    228     def test_booleanfield_get_db_prep_lookup(self):
     228    def test_BooleanField_get_db_prep_lookup(self):
    229229        self._test_get_db_prep_lookup(models.BooleanField())
    230230
    231     def test_nullbooleanfield_get_db_prep_lookup(self):
     231    def test_NullBooleanField_get_db_prep_lookup(self):
    232232        self._test_get_db_prep_lookup(models.NullBooleanField())
    233233
    234     def test_booleanfield_to_python(self):
     234    def test_BooleanField_to_python(self):
    235235        self._test_to_python(models.BooleanField())
    236236
    237     def test_nullbooleanfield_to_python(self):
     237    def test_NullBooleanField_to_python(self):
    238238        self._test_to_python(models.NullBooleanField())
    239239
    240     def test_charfield_textfield_max_length_passed_to_formfield(self):
     240    def test_CharField_TextField_max_length_passed_to_formfield(self):
    241241        """
    242242        Test that CharField and TextField pass their max_length attributes to
    243243        form fields created using their .formfield() method (#22206).
    class BooleanFieldTests(unittest.TestCase): 
    252252        self.assertIsNone(tf1.formfield().max_length)
    253253        self.assertEqual(2345, tf2.formfield().max_length)
    254254
    255     def test_booleanfield_choices_blank(self):
     255    def test_BooleanField_choices_blank(self):
    256256        """
    257257        Test that BooleanField with choices and defaults doesn't generate a
    258258        formfield with the blank option (#9640, #10549).
    class ChoicesTests(test.TestCase): 
    377377
    378378
    379379class SlugFieldTests(test.TestCase):
    380     def test_slugfield_max_length(self):
     380    def test_SlugField_max_length(self):
    381381        """
    382382        Make sure SlugField honors max_length (#9706)
    383383        """
    class SlugFieldTests(test.TestCase): 
    387387
    388388
    389389class ValidationTest(test.TestCase):
    390     def test_charfield_raises_error_on_empty_string(self):
     390    def test_CharField_raises_error_on_empty_string(self):
    391391        f = models.CharField()
    392392        self.assertRaises(ValidationError, f.clean, "", None)
    393393
    394     def test_charfield_cleans_empty_string_when_blank_true(self):
     394    def test_CharField_cleans_empty_string_when_blank_true(self):
    395395        f = models.CharField(blank=True)
    396396        self.assertEqual('', f.clean('', None))
    397397
    398     def test_integerfield_cleans_valid_string(self):
     398    def test_IntegerField_cleans_valid_string(self):
    399399        f = models.IntegerField()
    400400        self.assertEqual(2, f.clean('2', None))
    401401
    402     def test_integerfield_raises_error_on_invalid_intput(self):
     402    def test_IntegerField_raises_error_on_invalid_intput(self):
    403403        f = models.IntegerField()
    404404        self.assertRaises(ValidationError, f.clean, "a", None)
    405405
    406     def test_charfield_with_choices_cleans_valid_choice(self):
     406    def test_CharField_with_choices_cleans_valid_choice(self):
    407407        f = models.CharField(max_length=1,
    408408                             choices=[('a', 'A'), ('b', 'B')])
    409409        self.assertEqual('a', f.clean('a', None))
    410410
    411     def test_charfield_with_choices_raises_error_on_invalid_choice(self):
     411    def test_CharField_with_choices_raises_error_on_invalid_choice(self):
    412412        f = models.CharField(choices=[('a', 'A'), ('b', 'B')])
    413413        self.assertRaises(ValidationError, f.clean, "not a", None)
    414414
    415     def test_charfield_get_choices_with_blank_defined(self):
     415    def test_CharField_get_choices_with_blank_defined(self):
    416416        f = models.CharField(choices=[('', '<><>'), ('a', 'A')])
    417417        self.assertEqual(f.get_choices(True), [('', '<><>'), ('a', 'A')])
    418418
    class ValidationTest(test.TestCase): 
    421421            choices=(('group', ((10, 'A'), (20, 'B'))), (30, 'C')))
    422422        self.assertEqual(10, f.clean(10, None))
    423423
    424     def test_nullable_integerfield_raises_error_with_blank_false(self):
     424    def test_nullable_IntegerField_raises_error_with_blank_false(self):
    425425        f = models.IntegerField(null=True, blank=False)
    426426        self.assertRaises(ValidationError, f.clean, None, None)
    427427
    428     def test_nullable_integerfield_cleans_none_on_null_and_blank_true(self):
     428    def test_nullable_IntegerField_cleans_none_on_null_and_blank_true(self):
    429429        f = models.IntegerField(null=True, blank=True)
    430430        self.assertEqual(None, f.clean(None, None))
    431431
    432     def test_integerfield_raises_error_on_empty_input(self):
     432    def test_IntegerField_raises_error_on_empty_input(self):
    433433        f = models.IntegerField(null=False)
    434434        self.assertRaises(ValidationError, f.clean, None, None)
    435435        self.assertRaises(ValidationError, f.clean, '', None)
    436436
    437     def test_integerfield_validates_zero_against_choices(self):
     437    def test_IntegerField_validates_zero_against_choices(self):
    438438        f = models.IntegerField(choices=((1, 1),))
    439439        self.assertRaises(ValidationError, f.clean, '0', None)
    440440
    441     def test_charfield_raises_error_on_empty_input(self):
     441    def test_CharField_raises_error_on_empty_input(self):
    442442        f = models.CharField(null=False)
    443443        self.assertRaises(ValidationError, f.clean, None, None)
    444444
    445     def test_datefield_cleans_date(self):
     445    def test_DateField_cleans_date(self):
    446446        f = models.DateField()
    447447        self.assertEqual(datetime.date(2008, 10, 10), f.clean('2008-10-10', None))
    448448
    449     def test_boolean_field_doesnt_accept_empty_input(self):
     449    def test_BooleanField_does_not_accept_empty_input(self):
    450450        f = models.BooleanField()
    451451        self.assertRaises(ValidationError, f.clean, None, None)
    452452
    class TypeCoercionTests(test.TestCase): 
    546546    automatic casting at the DB level. See #10015.
    547547
    548548    """
    549     def test_lookup_integer_in_charfield(self):
     549    def test_lookup_integer_in_CharField(self):
    550550        self.assertEqual(Post.objects.filter(title=9).count(), 0)
    551551
    552     def test_lookup_integer_in_textfield(self):
     552    def test_lookup_integer_in_TextField(self):
    553553        self.assertEqual(Post.objects.filter(body=24).count(), 0)
    554554
    555555
    class BinaryFieldTests(test.TestCase): 
    626626
    627627
    628628class GenericIPAddressFieldTests(test.TestCase):
    629     def test_genericipaddressfield_formfield_protocol(self):
     629    def test_GenericIPAddressField_formfield_protocol(self):
    630630        """
    631631        Test that GenericIPAddressField with a specified protocol does not
    632632        generate a formfield with no specified protocol. See #20740.
  • tests/nested_foreign_keys/tests.py

    -- 
    1.9.1
    
    
    From bf34e6190df549374cfec224e6ab91583bbefe6e Mon Sep 17 00:00:00 2001
    From: Brylie Christopher Oxley <brylie@gnumedia.org>
    Date: Mon, 30 Jun 2014 16:54:11 +0300
    Subject: [PATCH 09/12] Changed camel case test names.
    
    ---
     tests/nested_foreign_keys/tests.py | 12 ++++++------
     1 file changed, 6 insertions(+), 6 deletions(-)
    
    diff --git a/tests/nested_foreign_keys/tests.py b/tests/nested_foreign_keys/tests.py
    index faf9f60..e08922a 100644
    a b class NestedForeignKeysTests(TestCase): 
    3131
    3232    # This test failed in #16715 because in some cases INNER JOIN was selected
    3333    # for the second foreign key relation instead of LEFT OUTER JOIN.
    34     def testInheritance(self):
     34    def test_inheritance(self):
    3535        Event.objects.create()
    3636        Screening.objects.create(movie=self.movie)
    3737
    class NestedForeignKeysTests(TestCase): 
    5252        self.assertEqual(Event.objects.exclude(screening__movie=self.movie).count(), 1)
    5353
    5454    # These all work because the second foreign key in the chain has null=True.
    55     def testInheritanceNullFK(self):
     55    def test_inheritance_null_FK(self):
    5656        Event.objects.create()
    5757        ScreeningNullFK.objects.create(movie=None)
    5858        ScreeningNullFK.objects.create(movie=self.movie)
    class NestedForeignKeysTests(TestCase): 
    7979
    8080    # This test failed in #16715 because in some cases INNER JOIN was selected
    8181    # for the second foreign key relation instead of LEFT OUTER JOIN.
    82     def testExplicitForeignKey(self):
     82    def test_explicit_ForeignKey(self):
    8383        Package.objects.create()
    8484        screening = Screening.objects.create(movie=self.movie)
    8585        Package.objects.create(screening=screening)
    class NestedForeignKeysTests(TestCase): 
    9999        self.assertEqual(Package.objects.exclude(screening__movie=self.movie).count(), 1)
    100100
    101101    # These all work because the second foreign key in the chain has null=True.
    102     def testExplicitForeignKeyNullFK(self):
     102    def test_explicit_ForeignKey_NullFK(self):
    103103        PackageNullFK.objects.create()
    104104        screening = ScreeningNullFK.objects.create(movie=None)
    105105        screening_with_movie = ScreeningNullFK.objects.create(movie=self.movie)
    class DeeplyNestedForeignKeysTests(TestCase): 
    128128        self.director = Person.objects.create(name='Terry Gilliam / Terry Jones')
    129129        self.movie = Movie.objects.create(title='Monty Python and the Holy Grail', director=self.director)
    130130
    131     def testInheritance(self):
     131    def test_inheritance(self):
    132132        Event.objects.create()
    133133        Screening.objects.create(movie=self.movie)
    134134
    class DeeplyNestedForeignKeysTests(TestCase): 
    147147        self.assertEqual(Event.objects.filter(screening__movie__director=self.director).count(), 1)
    148148        self.assertEqual(Event.objects.exclude(screening__movie__director=self.director).count(), 1)
    149149
    150     def testExplicitForeignKey(self):
     150    def test_explicit_ForeignKey(self):
    151151        Package.objects.create()
    152152        screening = Screening.objects.create(movie=self.movie)
    153153        Package.objects.create(screening=screening)
  • tests/raw_query/tests.py

    -- 
    1.9.1
    
    
    From f12558b8b9db7f8a43f018c7735ade57ebaf2930 Mon Sep 17 00:00:00 2001
    From: Brylie Christopher Oxley <brylie@gnumedia.org>
    Date: Mon, 30 Jun 2014 17:01:28 +0300
    Subject: [PATCH 10/12] Modified camel case test names.
    
    ---
     tests/raw_query/tests.py | 32 ++++++++++++++++----------------
     1 file changed, 16 insertions(+), 16 deletions(-)
    
    diff --git a/tests/raw_query/tests.py b/tests/raw_query/tests.py
    index 17479df..80372c1 100644
    a b class RawQueryTests(TestCase): 
    5959                self.assertTrue(hasattr(result, annotation))
    6060                self.assertEqual(getattr(result, annotation), value)
    6161
    62     def testSimpleRawQuery(self):
     62    def test_simple_raw_query(self):
    6363        """
    6464        Basic test of raw query with a simple database query
    6565        """
    class RawQueryTests(TestCase): 
    6767        authors = Author.objects.all()
    6868        self.assertSuccessfulRawQuery(Author, query, authors)
    6969
    70     def testRawQueryLazy(self):
     70    def test_raw_query_lazy(self):
    7171        """
    7272        Raw queries are lazy: they aren't actually executed until they're
    7373        iterated over.
    class RawQueryTests(TestCase): 
    7777        list(q)
    7878        self.assertTrue(q.query.cursor is not None)
    7979
    80     def testFkeyRawQuery(self):
     80    def test_FK_raw_query(self):
    8181        """
    8282        Test of a simple raw query against a model containing a foreign key
    8383        """
    class RawQueryTests(TestCase): 
    8585        books = Book.objects.all()
    8686        self.assertSuccessfulRawQuery(Book, query, books)
    8787
    88     def testDBColumnHandler(self):
     88    def test_db_column_handler(self):
    8989        """
    9090        Test of a simple raw query against a model containing a field with
    9191        db_column defined.
    class RawQueryTests(TestCase): 
    9494        coffees = Coffee.objects.all()
    9595        self.assertSuccessfulRawQuery(Coffee, query, coffees)
    9696
    97     def testOrderHandler(self):
     97    def test_order_handler(self):
    9898        """
    9999        Test of raw raw query's tolerance for columns being returned in any
    100100        order
    class RawQueryTests(TestCase): 
    110110            authors = Author.objects.all()
    111111            self.assertSuccessfulRawQuery(Author, query, authors)
    112112
    113     def testTranslations(self):
     113    def test_translations(self):
    114114        """
    115115        Test of raw query's optional ability to translate unexpected result
    116116        column names to specific model fields
    class RawQueryTests(TestCase): 
    120120        authors = Author.objects.all()
    121121        self.assertSuccessfulRawQuery(Author, query, authors, translations=translations)
    122122
    123     def testParams(self):
     123    def test_params(self):
    124124        """
    125125        Test passing optional query parameters
    126126        """
    class RawQueryTests(TestCase): 
    135135        self.assertIsInstance(repr(qset), str)
    136136
    137137    @skipUnlessDBFeature('supports_paramstyle_pyformat')
    138     def testPyformatParams(self):
     138    def test_pyformat_params(self):
    139139        """
    140140        Test passing optional query parameters
    141141        """
    class RawQueryTests(TestCase): 
    149149        self.assertEqual(len(results), 1)
    150150        self.assertIsInstance(repr(qset), str)
    151151
    152     def testManyToMany(self):
     152    def test_many_to_many(self):
    153153        """
    154154        Test of a simple raw query against a model containing a m2m field
    155155        """
    class RawQueryTests(TestCase): 
    157157        reviewers = Reviewer.objects.all()
    158158        self.assertSuccessfulRawQuery(Reviewer, query, reviewers)
    159159
    160     def testExtraConversions(self):
     160    def test_extra_conversions(self):
    161161        """
    162162        Test to insure that extra translations are ignored.
    163163        """
    class RawQueryTests(TestCase): 
    166166        authors = Author.objects.all()
    167167        self.assertSuccessfulRawQuery(Author, query, authors, translations=translations)
    168168
    169     def testMissingFields(self):
     169    def test_missing_fields(self):
    170170        query = "SELECT id, first_name, dob FROM raw_query_author"
    171171        for author in Author.objects.raw(query):
    172172            self.assertNotEqual(author.first_name, None)
    173173            # last_name isn't given, but it will be retrieved on demand
    174174            self.assertNotEqual(author.last_name, None)
    175175
    176     def testMissingFieldsWithoutPK(self):
     176    def test_missing_fields_without_PK(self):
    177177        query = "SELECT first_name, dob FROM raw_query_author"
    178178        try:
    179179            list(Author.objects.raw(query))
    class RawQueryTests(TestCase): 
    181181        except InvalidQuery:
    182182            pass
    183183
    184     def testAnnotations(self):
     184    def test_annotations(self):
    185185        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"
    186186        expected_annotations = (
    187187            ('book_count', 3),
    class RawQueryTests(TestCase): 
    192192        authors = Author.objects.all()
    193193        self.assertSuccessfulRawQuery(Author, query, authors, expected_annotations)
    194194
    195     def testWhiteSpaceQuery(self):
     195    def test_white_space_query(self):
    196196        query = "    SELECT * FROM raw_query_author"
    197197        authors = Author.objects.all()
    198198        self.assertSuccessfulRawQuery(Author, query, authors)
    199199
    200     def testMultipleIterations(self):
     200    def test_multiple_iterations(self):
    201201        query = "SELECT * FROM raw_query_author"
    202202        normal_authors = Author.objects.all()
    203203        raw_authors = Author.objects.raw(query)
    class RawQueryTests(TestCase): 
    216216
    217217        self.assertEqual(first_iterations, second_iterations)
    218218
    219     def testGetItem(self):
     219    def test_get_item(self):
    220220        # Indexing on RawQuerySets
    221221        query = "SELECT * FROM raw_query_author ORDER BY id ASC"
    222222        third_author = Author.objects.raw(query)[2]
  • tests/utils_tests/test_http.py

    -- 
    1.9.1
    
    
    From fa19d6014682fcd01f6014244f31685d02556900 Mon Sep 17 00:00:00 2001
    From: Brylie Christopher Oxley <brylie@gnumedia.org>
    Date: Mon, 30 Jun 2014 17:57:04 +0300
    Subject: [PATCH 11/12] Modified camel case test names.
    
    ---
     tests/utils_tests/test_http.py | 10 +++++-----
     1 file changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/tests/utils_tests/test_http.py b/tests/utils_tests/test_http.py
    index eec439a..3f512ad 100644
    a b class TestUtilsHttp(unittest.TestCase): 
    121121
    122122
    123123class ETagProcessingTests(unittest.TestCase):
    124     def testParsing(self):
     124    def test_parsing(self):
    125125        etags = http.parse_etags(r'"", "etag", "e\"t\"ag", "e\\tag", W/"weak"')
    126126        self.assertEqual(etags, ['', 'etag', 'e"t"ag', r'e\tag', 'weak'])
    127127
    128     def testQuoting(self):
     128    def test_quoting(self):
    129129        quoted_etag = http.quote_etag(r'e\t"ag')
    130130        self.assertEqual(quoted_etag, r'"e\\t\"ag"')
    131131
    132132
    133133class HttpDateProcessingTests(unittest.TestCase):
    134     def testParsingRfc1123(self):
     134    def test_parsing_rfc1123(self):
    135135        parsed = http.parse_http_date('Sun, 06 Nov 1994 08:49:37 GMT')
    136136        self.assertEqual(datetime.utcfromtimestamp(parsed),
    137137                         datetime(1994, 11, 6, 8, 49, 37))
    138138
    139     def testParsingRfc850(self):
     139    def test_parsing_rfc850(self):
    140140        parsed = http.parse_http_date('Sunday, 06-Nov-94 08:49:37 GMT')
    141141        self.assertEqual(datetime.utcfromtimestamp(parsed),
    142142                         datetime(1994, 11, 6, 8, 49, 37))
    143143
    144     def testParsingAsctime(self):
     144    def test_parsing_asctime(self):
    145145        parsed = http.parse_http_date('Sun Nov  6 08:49:37 1994')
    146146        self.assertEqual(datetime.utcfromtimestamp(parsed),
    147147                         datetime(1994, 11, 6, 8, 49, 37))
  • tests/view_tests/tests/test_i18n.py

    -- 
    1.9.1
    
    
    From bdbcc5090719bfd9e57ef2f1ff7925e3dbed3a9c Mon Sep 17 00:00:00 2001
    From: Brylie Christopher Oxley <brylie@gnumedia.org>
    Date: Mon, 30 Jun 2014 18:06:59 +0300
    Subject: [PATCH 12/12] Modified camel case test names.
    
    ---
     tests/view_tests/tests/test_i18n.py | 12 ++++++------
     1 file changed, 6 insertions(+), 6 deletions(-)
    
    diff --git a/tests/view_tests/tests/test_i18n.py b/tests/view_tests/tests/test_i18n.py
    index 8798c0d..a40491c 100644
    a b class JsI18NTests(TestCase): 
    115115            response = self.client.get('/jsi18n/')
    116116            self.assertContains(response, 'il faut le traduire')
    117117
    118     def testI18NLanguageNonEnglishDefault(self):
     118    def test_i18n_language_non_english_default(self):
    119119        """
    120120        Check if the Javascript i18n view returns an empty language catalog
    121121        if the default language is non-English, the selected language
    class JsI18NTests(TestCase): 
    127127            self.assertNotContains(response, 'Choisir une heure')
    128128
    129129    @modify_settings(INSTALLED_APPS={'append': 'view_tests.app0'})
    130     def test_nonenglish_default_english_userpref(self):
     130    def test_non_english_default_english_userpref(self):
    131131        """
    132132        Same as above with the difference that there IS an 'en' translation
    133133        available. The Javascript i18n view must return a NON empty language catalog
    class JsI18NTests(TestCase): 
    137137            response = self.client.get('/jsi18n_english_translation/')
    138138            self.assertContains(response, 'this app0 string is to be translated')
    139139
    140     def testI18NLanguageNonEnglishFallback(self):
     140    def test_i18n_language_non_english_fallback(self):
    141141        """
    142142        Makes sure that the fallback language is still working properly
    143143        in cases where the selected language cannot be found.
    class JsI18NTestsMultiPackage(TestCase): 
    170170    settings.LANGUAGE_CODE and merge JS translation from several packages.
    171171    """
    172172    @modify_settings(INSTALLED_APPS={'append': ['view_tests.app1', 'view_tests.app2']})
    173     def testI18NLanguageEnglishDefault(self):
     173    def test_i18n_language_english_default(self):
    174174        """
    175175        Check if the JavaScript i18n view returns a complete language catalog
    176176        if the default language is en-us, the selected language has a
    class JsI18NTestsMultiPackage(TestCase): 
    183183            self.assertContains(response, 'il faut traduire cette cha\\u00eene de caract\\u00e8res de app1')
    184184
    185185    @modify_settings(INSTALLED_APPS={'append': ['view_tests.app3', 'view_tests.app4']})
    186     def testI18NDifferentNonEnLangs(self):
     186    def test_i18n_different_non_english_languages(self):
    187187        """
    188188        Similar to above but with neither default or requested language being
    189189        English.
    class JsI18NTestsMultiPackage(TestCase): 
    192192            response = self.client.get('/jsi18n_multi_packages2/')
    193193            self.assertContains(response, 'este texto de app3 debe ser traducido')
    194194
    195     def testI18NWithLocalePaths(self):
     195    def test_i18n_with_locale_paths(self):
    196196        extended_locale_paths = settings.LOCALE_PATHS + (
    197197            path.join(path.dirname(
    198198                path.dirname(path.abspath(upath(__file__)))), 'app3', 'locale'),)
Back to Top