Permalink
Browse files

[1.7.x] Fixed #22909 -- Removed camelCasing in some tests.

Thanks brylie.

Backport of 89b9e6e from master
  • Loading branch information...
1 parent c379fc4 commit 28962c57f3f2b4543cd67d55ca635e9198f585dd @timgraham timgraham committed Jul 7, 2014
@@ -25,15 +25,15 @@ def setUp(self):
def tearDown(self):
self.client.logout()
- def testBasicAddGet(self):
+ def test_basic_add_GET(self):
"""
Ensure GET on the add_view works.
"""
response = self.client.get('/admin/admin_custom_urls/action/!add/')
self.assertIsInstance(response, TemplateResponse)
self.assertEqual(response.status_code, 200)
- def testAddWithGETArgs(self):
+ def test_add_with_GET_args(self):
"""
Ensure GET on the add_view plus specifying a field value in the query
string works.
@@ -42,7 +42,7 @@ def testAddWithGETArgs(self):
self.assertEqual(response.status_code, 200)
self.assertContains(response, 'value="My Action"')
- def testBasicAddPost(self):
+ def test_basic_add_POST(self):
"""
Ensure POST on add_view works.
"""
@@ -56,7 +56,7 @@ def testBasicAddPost(self):
self.assertContains(response, 'dismissAddAnotherPopup')
self.assertContains(response, 'Action added through a popup')
- def testAdminUrlsNoClash(self):
+ def test_admin_URLs_no_clash(self):
"""
Test that some admin URLs work correctly.
"""
Oops, something went wrong.
@@ -71,61 +71,61 @@ class MyModelAdmin(admin.ModelAdmin):
# Return the formfield so that other tests can continue
return ff
- def testDateField(self):
+ def test_DateField(self):
self.assertFormfield(models.Event, 'start_date', widgets.AdminDateWidget)
- def testDateTimeField(self):
+ def test_DateTimeField(self):
self.assertFormfield(models.Member, 'birthdate', widgets.AdminSplitDateTime)
- def testTimeField(self):
+ def test_TimeField(self):
self.assertFormfield(models.Event, 'start_time', widgets.AdminTimeWidget)
- def testTextField(self):
+ def test_TextField(self):
self.assertFormfield(models.Event, 'description', widgets.AdminTextareaWidget)
- def testURLField(self):
+ def test_URLField(self):
self.assertFormfield(models.Event, 'link', widgets.AdminURLFieldWidget)
- def testIntegerField(self):
+ def test_IntegerField(self):
self.assertFormfield(models.Event, 'min_age', widgets.AdminIntegerFieldWidget)
- def testCharField(self):
+ def test_CharField(self):
self.assertFormfield(models.Member, 'name', widgets.AdminTextInputWidget)
- def testEmailField(self):
+ def test_EmailField(self):
self.assertFormfield(models.Member, 'email', widgets.AdminEmailInputWidget)
- def testFileField(self):
+ def test_FileField(self):
self.assertFormfield(models.Album, 'cover_art', widgets.AdminFileWidget)
- def testForeignKey(self):
+ def test_ForeignKey(self):
self.assertFormfield(models.Event, 'main_band', forms.Select)
- def testRawIDForeignKey(self):
+ def test_raw_id_ForeignKey(self):
self.assertFormfield(models.Event, 'main_band', widgets.ForeignKeyRawIdWidget,
raw_id_fields=['main_band'])
- def testRadioFieldsForeignKey(self):
+ def test_radio_fields_ForeignKey(self):
ff = self.assertFormfield(models.Event, 'main_band', widgets.AdminRadioSelect,
radio_fields={'main_band': admin.VERTICAL})
self.assertEqual(ff.empty_label, None)
- def testManyToMany(self):
+ def test_many_to_many(self):
self.assertFormfield(models.Band, 'members', forms.SelectMultiple)
- def testRawIDManyTOMany(self):
+ def test_raw_id_many_to_many(self):
self.assertFormfield(models.Band, 'members', widgets.ManyToManyRawIdWidget,
raw_id_fields=['members'])
- def testFilteredManyToMany(self):
+ def test_filtered_many_to_many(self):
self.assertFormfield(models.Band, 'members', widgets.FilteredSelectMultiple,
filter_vertical=['members'])
- def testFormfieldOverrides(self):
+ def test_formfield_overrides(self):
self.assertFormfield(models.Event, 'start_date', forms.TextInput,
formfield_overrides={DateField: {'widget': forms.TextInput}})
- def testFormfieldOverridesWidgetInstances(self):
+ def test_formfield_overrides_widget_instances(self):
"""
Test that widget instances in formfield_overrides are not shared between
different fields. (#19423)
@@ -142,14 +142,14 @@ class BandAdmin(admin.ModelAdmin):
self.assertEqual(f2.widget.attrs['maxlength'], '20')
self.assertEqual(f2.widget.attrs['size'], '10')
- def testFieldWithChoices(self):
+ def test_field_with_choices(self):
self.assertFormfield(models.Member, 'gender', forms.Select)
- def testChoicesWithRadioFields(self):
+ def test_choices_with_radio_fields(self):
self.assertFormfield(models.Member, 'gender', widgets.AdminRadioSelect,
radio_fields={'gender': admin.VERTICAL})
- def testInheritance(self):
+ def test_inheritance(self):
self.assertFormfield(models.Album, 'backside_art', widgets.AdminFileWidget)
def test_m2m_widgets(self):
@@ -169,7 +169,7 @@ class AdminFormfieldForDBFieldWithRequestTests(DjangoTestCase):
fixtures = ["admin-widgets-users.xml"]
urls = 'admin_widgets.urls'
- def testFilterChoicesByRequestUser(self):
+ def test_filter_choices_by_request_user(self):
"""
Ensure the user can only see their own cars in the foreign key dropdown.
"""
@@ -190,7 +190,7 @@ def setUp(self):
def tearDown(self):
self.client.logout()
- def test_changelist_foreignkey(self):
+ def test_changelist_ForeignKey(self):
response = self.client.get('/admin_widgets/car/')
self.assertContains(response, '/auth/user/add/')
@@ -959,7 +959,7 @@ def setUp(self):
models.Band.objects.create(id=98, name='Green Potatoes')
super(AdminRawIdWidgetSeleniumFirefoxTests, self).setUp()
- def test_foreignkey(self):
+ def test_ForeignKey(self):
self.admin_login(username='super', password='secret', login_url='/')
self.selenium.get(
'%s%s' % (self.live_server_url, '/admin_widgets/event/add/'))
@@ -1045,7 +1045,7 @@ class RelatedFieldWidgetSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase):
urls = "admin_widgets.urls"
webdriver_class = 'selenium.webdriver.firefox.webdriver.WebDriver'
- def test_foreign_key_using_to_field(self):
+ def test_ForeignKey_using_to_field(self):
self.admin_login(username='super', password='secret', login_url='/')
self.selenium.get('%s%s' % (
self.live_server_url,
@@ -16,7 +16,7 @@
class Bug639Test(unittest.TestCase):
- def testBug639(self):
+ def test_bug_639(self):
"""
Simulate a file upload and check how many times Model.save() gets
called.
@@ -31,11 +31,11 @@ def assertNotModified(self, response):
self.assertEqual(response.status_code, 304)
self.assertEqual(response.content, b'')
- def testWithoutConditions(self):
+ def test_without_conditions(self):
response = self.client.get('/condition/')
self.assertFullResponse(response)
- def testIfModifiedSince(self):
+ def test_if_modified_since(self):
self.client.defaults['HTTP_IF_MODIFIED_SINCE'] = LAST_MODIFIED_STR
response = self.client.get('/condition/')
self.assertNotModified(response)
@@ -49,7 +49,7 @@ def testIfModifiedSince(self):
response = self.client.get('/condition/')
self.assertFullResponse(response)
- def testIfNoneMatch(self):
+ def test_if_none_match(self):
self.client.defaults['HTTP_IF_NONE_MATCH'] = '"%s"' % ETAG
response = self.client.get('/condition/')
self.assertNotModified(response)
@@ -62,15 +62,15 @@ def testIfNoneMatch(self):
response = self.client.get('/condition/')
self.assertNotModified(response)
- def testIfMatch(self):
+ def test_if_match(self):
self.client.defaults['HTTP_IF_MATCH'] = '"%s"' % ETAG
response = self.client.put('/condition/etag/')
self.assertEqual(response.status_code, 200)
self.client.defaults['HTTP_IF_MATCH'] = '"%s"' % EXPIRED_ETAG
response = self.client.put('/condition/etag/')
self.assertEqual(response.status_code, 412)
- def testBothHeaders(self):
+ def test_both_headers(self):
self.client.defaults['HTTP_IF_MODIFIED_SINCE'] = LAST_MODIFIED_STR
self.client.defaults['HTTP_IF_NONE_MATCH'] = '"%s"' % ETAG
response = self.client.get('/condition/')
@@ -86,45 +86,45 @@ def testBothHeaders(self):
response = self.client.get('/condition/')
self.assertFullResponse(response)
- def testSingleCondition1(self):
+ def test_single_condition_1(self):
self.client.defaults['HTTP_IF_MODIFIED_SINCE'] = LAST_MODIFIED_STR
response = self.client.get('/condition/last_modified/')
self.assertNotModified(response)
response = self.client.get('/condition/etag/')
self.assertFullResponse(response, check_last_modified=False)
- def testSingleCondition2(self):
+ def test_single_condition_2(self):
self.client.defaults['HTTP_IF_NONE_MATCH'] = '"%s"' % ETAG
response = self.client.get('/condition/etag/')
self.assertNotModified(response)
response = self.client.get('/condition/last_modified/')
self.assertFullResponse(response, check_etag=False)
- def testSingleCondition3(self):
+ def test_single_condition_3(self):
self.client.defaults['HTTP_IF_MODIFIED_SINCE'] = EXPIRED_LAST_MODIFIED_STR
response = self.client.get('/condition/last_modified/')
self.assertFullResponse(response, check_etag=False)
- def testSingleCondition4(self):
+ def test_single_condition_4(self):
self.client.defaults['HTTP_IF_NONE_MATCH'] = '"%s"' % EXPIRED_ETAG
response = self.client.get('/condition/etag/')
self.assertFullResponse(response, check_last_modified=False)
- def testSingleCondition5(self):
+ def test_single_condition_5(self):
self.client.defaults['HTTP_IF_MODIFIED_SINCE'] = LAST_MODIFIED_STR
response = self.client.get('/condition/last_modified2/')
self.assertNotModified(response)
response = self.client.get('/condition/etag2/')
self.assertFullResponse(response, check_last_modified=False)
- def testSingleCondition6(self):
+ def test_single_condition_6(self):
self.client.defaults['HTTP_IF_NONE_MATCH'] = '"%s"' % ETAG
response = self.client.get('/condition/etag2/')
self.assertNotModified(response)
response = self.client.get('/condition/last_modified2/')
self.assertFullResponse(response, check_etag=False)
- def testInvalidETag(self):
+ def test_invalid_etag(self):
self.client.defaults['HTTP_IF_NONE_MATCH'] = r'"\"'
response = self.client.get('/condition/etag/')
self.assertFullResponse(response, check_last_modified=False)
@@ -52,23 +52,23 @@ def _testIsClean(self, signal):
self.assertFalse(signal.has_listeners())
self.assertEqual(signal.receivers, [])
- def testExact(self):
+ def test_exact(self):
a_signal.connect(receiver_1_arg, sender=self)
expected = [(receiver_1_arg, "test")]
result = a_signal.send(sender=self, val="test")
self.assertEqual(result, expected)
a_signal.disconnect(receiver_1_arg, sender=self)
self._testIsClean(a_signal)
- def testIgnoredSender(self):
+ def test_ignored_sender(self):
a_signal.connect(receiver_1_arg)
expected = [(receiver_1_arg, "test")]
result = a_signal.send(sender=self, val="test")
self.assertEqual(result, expected)
a_signal.disconnect(receiver_1_arg)
self._testIsClean(a_signal)
- def testGarbageCollected(self):
+ def test_garbage_collected(self):
a = Callable()
a_signal.connect(a.a, sender=self)
expected = []
@@ -78,7 +78,7 @@ def testGarbageCollected(self):
self.assertEqual(result, expected)
self._testIsClean(a_signal)
- def testCachedGarbagedCollected(self):
+ def test_cached_garbaged_collected(self):
"""
Make sure signal caching sender receivers don't prevent garbage
collection of senders.
@@ -96,7 +96,7 @@ class sender:
# Disconnect after reference check since it flushes the tested cache.
d_signal.disconnect(receiver_1_arg)
- def testMultipleRegistration(self):
+ def test_multiple_registration(self):
a = Callable()
a_signal.connect(a)
a_signal.connect(a)
@@ -112,7 +112,7 @@ def testMultipleRegistration(self):
garbage_collect()
self._testIsClean(a_signal)
- def testUidRegistration(self):
+ def test_uid_registration(self):
def uid_based_receiver_1(**kwargs):
pass
@@ -125,7 +125,7 @@ def uid_based_receiver_2(**kwargs):
a_signal.disconnect(dispatch_uid="uid")
self._testIsClean(a_signal)
- def testRobust(self):
+ def test_robust(self):
"""Test the sendRobust function"""
def fails(val, **kwargs):
raise ValueError('this')
@@ -137,7 +137,7 @@ def fails(val, **kwargs):
a_signal.disconnect(fails)
self._testIsClean(a_signal)
- def testDisconnection(self):
+ def test_disconnection(self):
receiver_1 = Callable()
receiver_2 = Callable()
receiver_3 = Callable()
@@ -167,15 +167,15 @@ class ReceiverTestCase(unittest.TestCase):
Test suite for receiver.
"""
- def testReceiverSingleSignal(self):
+ def test_receiver_single_signal(self):
@receiver(a_signal)
def f(val, **kwargs):
self.state = val
self.state = False
a_signal.send(sender=self, val=True)
self.assertTrue(self.state)
- def testReceiverSignalList(self):
+ def test_receiver_signal_list(self):
@receiver([a_signal, b_signal, c_signal])
def f(val, **kwargs):
self.state.append(val)
Oops, something went wrong.

0 comments on commit 28962c5

Please sign in to comment.