Ticket #23995: 23995.diff

File 23995.diff, 15.6 KB (added by Diego Guimarães, 8 years ago)
  • tests/admin_custom_urls/tests.py

    diff --git a/tests/admin_custom_urls/tests.py b/tests/admin_custom_urls/tests.py
    index edabb6e..d327b33 100644
    a b class AdminCustomUrlsTest(TestCase): 
    2222    def setUp(self):
    2323        self.client.login(username='super', password='secret')
    2424
    25     def tearDown(self):
    26         self.client.logout()
    27 
    2825    def test_basic_add_GET(self):
    2926        """
    3027        Ensure GET on the add_view works.
    class CustomRedirects(TestCase): 
    9188    def setUp(self):
    9289        self.client.login(username='super', password='secret')
    9390
    94     def tearDown(self):
    95         self.client.logout()
    96 
    9791    def test_post_save_add_redirect(self):
    9892        """
    9993        Ensures that ModelAdmin.response_post_save_add() controls the
  • tests/admin_inlines/tests.py

    diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py
    index 7d8be94..ed931a0 100644
    a b class TestInline(TestCase): 
    3636        self.assertEqual(result, True)
    3737        self.factory = RequestFactory()
    3838
    39     def tearDown(self):
    40         self.client.logout()
    41 
    4239    def test_can_delete(self):
    4340        """
    4441        can_delete should be passed to inlineformset factory.
    class TestInlineMedia(TestCase): 
    359356        result = self.client.login(username='super', password='secret')
    360357        self.assertEqual(result, True)
    361358
    362     def tearDown(self):
    363         self.client.logout()
    364 
    365359    def test_inline_media_only_base(self):
    366360        holder = Holder(dummy=13)
    367361        holder.save()
    class TestInlineProtectedOnDelete(TestCase): 
    438432        result = self.client.login(username='super', password='secret')
    439433        self.assertEqual(result, True)
    440434
    441     def tearDown(self):
    442         self.client.logout()
    443 
    444435    def test_deleting_inline_with_protected_delete_does_not_validate(self):
    445436        lotr = Novel.objects.create(name='Lord of the rings')
    446437        chapter = Chapter.objects.create(novel=lotr, name='Many Meetings')
    class TestInlinePermissions(TestCase): 
    514505            self.client.login(username='admin', password='secret'),
    515506            True)
    516507
    517     def tearDown(self):
    518         self.client.logout()
    519 
    520508    def test_inline_add_m2m_noperm(self):
    521509        response = self.client.get('/admin/admin_inlines/author/add/')
    522510        # No change permission on books, so no inline
  • tests/admin_views/tests.py

    diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
    index c054730..1fc492c 100644
    a b class AdminViewBasicTestCase(TestCase): 
    8181        self.client.login(username='super', password='secret')
    8282
    8383    def tearDown(self):
    84         self.client.logout()
    8584        formats.reset_format_cache()
    8685
    8786    def assertContentBefore(self, response, text1, text2, failing_msg=None):
    class AdminViewFormUrlTest(TestCase): 
    876875    def setUp(self):
    877876        self.client.login(username='super', password='secret')
    878877
    879     def tearDown(self):
    880         self.client.logout()
    881 
    882878    def test_change_form_URL_has_correct_value(self):
    883879        """
    884880        Tests whether change_view has form_url in response.context
    class AdminJavaScriptTest(TestCase): 
    909905    def setUp(self):
    910906        self.client.login(username='super', password='secret')
    911907
    912     def tearDown(self):
    913         self.client.logout()
    914 
    915908    def test_js_minified_only_if_debug_is_false(self):
    916909        """
    917910        Ensure that the minified versions of the JS files are only used when
    class SaveAsTests(TestCase): 
    954947    def setUp(self):
    955948        self.client.login(username='super', password='secret')
    956949
    957     def tearDown(self):
    958         self.client.logout()
    959 
    960950    def test_save_as_duplication(self):
    961951        """Ensure save as actually creates a new person"""
    962952        post_data = {'_saveasnew': '', 'name': 'John M', 'gender': 1, 'age': 42}
    class AdminViewDeletedObjectsTest(TestCase): 
    17001690    def setUp(self):
    17011691        self.client.login(username='super', password='secret')
    17021692
    1703     def tearDown(self):
    1704         self.client.logout()
    1705 
    17061693    def test_nesting(self):
    17071694        """
    17081695        Objects should be nested to display the relationships that
    class AdminViewStringPrimaryKeyTest(TestCase): 
    18391826        content_type_pk = ContentType.objects.get_for_model(ModelWithStringPrimaryKey).pk
    18401827        LogEntry.objects.log_action(100, content_type_pk, self.pk, self.pk, 2, change_message='Changed something')
    18411828
    1842     def tearDown(self):
    1843         self.client.logout()
    1844 
    18451829    def test_get_history_view(self):
    18461830        """
    18471831        Retrieving the history for an object using urlencoded form of primary
    class SecureViewTests(TestCase): 
    19911975    """
    19921976    fixtures = ['admin-views-users.xml']
    19931977
    1994     def tearDown(self):
    1995         self.client.logout()
    1996 
    19971978    def test_secure_view_shows_login_if_not_logged_in(self):
    19981979        """
    19991980        Ensure that we see the admin login form.
    class AdminViewUnicodeTest(TestCase): 
    20141995    def setUp(self):
    20151996        self.client.login(username='super', password='secret')
    20161997
    2017     def tearDown(self):
    2018         self.client.logout()
    2019 
    20201998    def test_unicode_edit(self):
    20211999        """
    20222000        A test to ensure that POST on edit_view handles non-ASCII characters.
    class AdminViewListEditable(TestCase): 
    20692047    def setUp(self):
    20702048        self.client.login(username='super', password='secret')
    20712049
    2072     def tearDown(self):
    2073         self.client.logout()
    2074 
    20752050    def test_inheritance(self):
    20762051        Podcast.objects.create(name="This Week in Django",
    20772052            release_date=datetime.date.today())
    class AdminSearchTest(TestCase): 
    24472422    def setUp(self):
    24482423        self.client.login(username='super', password='secret')
    24492424
    2450     def tearDown(self):
    2451         self.client.logout()
    2452 
    24532425    def test_search_on_sibling_models(self):
    24542426        "Check that a search that mentions sibling models"
    24552427        response = self.client.get('/test_admin/admin/admin_views/recommendation/?q=bar')
    class AdminInheritedInlinesTest(TestCase): 
    25332505    def setUp(self):
    25342506        self.client.login(username='super', password='secret')
    25352507
    2536     def tearDown(self):
    2537         self.client.logout()
    2538 
    25392508    def test_inline(self):
    25402509        "Ensure that inline models which inherit from a common parent are correctly handled by admin."
    25412510
    class AdminActionsTest(TestCase): 
    26212590    def setUp(self):
    26222591        self.client.login(username='super', password='secret')
    26232592
    2624     def tearDown(self):
    2625         self.client.logout()
    2626 
    26272593    def test_model_admin_custom_action(self):
    26282594        "Tests a custom action defined in a ModelAdmin method"
    26292595        action_data = {
    class TestCustomChangeList(TestCase): 
    28952861        result = self.client.login(username='super', password='secret')
    28962862        self.assertEqual(result, True)
    28972863
    2898     def tearDown(self):
    2899         self.client.logout()
    2900 
    29012864    def test_custom_changelist(self):
    29022865        """
    29032866        Validate that a custom ChangeList class can be used (#9749)
    class TestInlineNotEditable(TestCase): 
    29232886        result = self.client.login(username='super', password='secret')
    29242887        self.assertEqual(result, True)
    29252888
    2926     def tearDown(self):
    2927         self.client.logout()
    2928 
    29292889    def test_GET_parent_add(self):
    29302890        """
    29312891        InlineModelAdmin broken?
    class AdminInlineFileUploadTest(TestCase): 
    32013161        self.picture = Picture(name="Test Picture", image=filename, gallery=self.gallery)
    32023162        self.picture.save()
    32033163
    3204     def tearDown(self):
    3205         self.client.logout()
    3206 
    32073164    def test_inline_file_upload_edit_validation_error_post(self):
    32083165        """
    32093166        Test that inline file uploads correctly display prior data (#10002).
    class AdminInlineTests(TestCase): 
    33223279        self.collector = Collector(pk=1, name='John Fowles')
    33233280        self.collector.save()
    33243281
    3325     def tearDown(self):
    3326         self.client.logout()
    3327 
    33283282    def test_simple_inline(self):
    33293283        "A simple model can be saved as inlines"
    33303284        # First add a new inline
    class NeverCacheTests(TestCase): 
    35533507    def setUp(self):
    35543508        self.client.login(username='super', password='secret')
    35553509
    3556     def tearDown(self):
    3557         self.client.logout()
    3558 
    35593510    def test_admin_index(self):
    35603511        "Check the never-cache status of the main index"
    35613512        response = self.client.get('/test_admin/admin/')
    class PrePopulatedTest(TestCase): 
    36273578    def setUp(self):
    36283579        self.client.login(username='super', password='secret')
    36293580
    3630     def tearDown(self):
    3631         self.client.logout()
    3632 
    36333581    def test_prepopulated_on(self):
    36343582        response = self.client.get('/test_admin/admin/admin_views/prepopulatedpost/add/')
    36353583        self.assertEqual(response.status_code, 200)
    class ReadonlyTest(TestCase): 
    38903838    def setUp(self):
    38913839        self.client.login(username='super', password='secret')
    38923840
    3893     def tearDown(self):
    3894         self.client.logout()
    3895 
    38963841    def test_readonly_get(self):
    38973842        response = self.client.get('/test_admin/admin/admin_views/post/add/')
    38983843        self.assertEqual(response.status_code, 200)
    class LimitChoicesToInAdminTest(TestCase): 
    40013946    def setUp(self):
    40023947        self.client.login(username='super', password='secret')
    40033948
    4004     def tearDown(self):
    4005         self.client.logout()
    4006 
    40073949    def test_limit_choices_to_as_callable(self):
    40083950        """Test for ticket 2445 changes to admin."""
    40093951        threepwood = Character.objects.create(
    class RawIdFieldsTest(TestCase): 
    40283970    def setUp(self):
    40293971        self.client.login(username='super', password='secret')
    40303972
    4031     def tearDown(self):
    4032         self.client.logout()
    4033 
    40343973    def test_limit_choices_to(self):
    40353974        """Regression test for 14880"""
    40363975        actor = Actor.objects.create(name="Palin", age=27)
    class UserAdminTest(TestCase): 
    41114050    def setUp(self):
    41124051        self.client.login(username='super', password='secret')
    41134052
    4114     def tearDown(self):
    4115         self.client.logout()
    4116 
    41174053    def test_save_button(self):
    41184054        user_count = User.objects.count()
    41194055        response = self.client.post('/test_admin/admin/auth/user/add/', {
    class GroupAdminTest(TestCase): 
    42134149    def setUp(self):
    42144150        self.client.login(username='super', password='secret')
    42154151
    4216     def tearDown(self):
    4217         self.client.logout()
    4218 
    42194152    def test_save_button(self):
    42204153        group_count = Group.objects.count()
    42214154        response = self.client.post('/test_admin/admin/auth/group/add/', {
    class CSSTest(TestCase): 
    42454178    def setUp(self):
    42464179        self.client.login(username='super', password='secret')
    42474180
    4248     def tearDown(self):
    4249         self.client.logout()
    4250 
    42514181    def test_field_prefix_css_classes(self):
    42524182        """
    42534183        Ensure that fields have a CSS class name with a 'field-' prefix.
    class AdminDocsTest(TestCase): 
    43714301    def setUp(self):
    43724302        self.client.login(username='super', password='secret')
    43734303
    4374     def tearDown(self):
    4375         self.client.logout()
    4376 
    43774304    def test_tags(self):
    43784305        response = self.client.get('/test_admin/admin/doc/tags/')
    43794306
    class ValidXHTMLTests(TestCase): 
    44154342    def setUp(self):
    44164343        self.client.login(username='super', password='secret')
    44174344
    4418     def tearDown(self):
    4419         self.client.logout()
    4420 
    44214345    @override_settings(
    44224346        TEMPLATE_CONTEXT_PROCESSORS=filter(
    44234347            lambda t: t != 'django.core.context_processors.i18n',
    class AdminViewLogoutTest(TestCase): 
    46304554    def setUp(self):
    46314555        self.client.login(username='super', password='secret')
    46324556
    4633     def tearDown(self):
    4634         self.client.logout()
    4635 
    46364557    def test_client_logout_url_can_be_used_to_login(self):
    46374558        response = self.client.get('/test_admin/admin/logout/')
    46384559        self.assertEqual(response.status_code, 200)
    class AdminUserMessageTest(TestCase): 
    46594580    def setUp(self):
    46604581        self.client.login(username='super', password='secret')
    46614582
    4662     def tearDown(self):
    4663         self.client.logout()
    4664 
    46654583    def send_message(self, level):
    46664584        """
    46674585        Helper that sends a post to the dummy test methods and asserts that a
    class AdminKeepChangeListFiltersTests(TestCase): 
    47184636    def setUp(self):
    47194637        self.client.login(username='super', password='secret')
    47204638
    4721     def tearDown(self):
    4722         self.client.logout()
    4723 
    47244639    def assertURLEqual(self, url1, url2):
    47254640        """
    47264641        Assert that two URLs are equal despite the ordering
    class AdminViewOnSiteTests(TestCase): 
    50444959    def setUp(self):
    50454960        self.client.login(username='super', password='secret')
    50464961
    5047     def tearDown(self):
    5048         self.client.logout()
    5049 
    50504962    def test_add_view_form_and_formsets_run_validation(self):
    50514963        """
    50524964        Issue #20522
    class InlineAdminViewOnSiteTest(TestCase): 
    51655077    def setUp(self):
    51665078        self.client.login(username='super', password='secret')
    51675079
    5168     def tearDown(self):
    5169         self.client.logout()
    5170 
    51715080    def test_false(self):
    51725081        "Ensure that the 'View on site' button is not displayed if view_on_site is False"
    51735082        response = self.client.get('/test_admin/admin/admin_views/state/1/')
  • tests/admin_widgets/tests.py

    diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py
    index 3c610d5..3180dbc 100644
    a b class AdminForeignKeyWidgetChangeList(DjangoTestCase): 
    190190    def setUp(self):
    191191        self.client.login(username="super", password="secret")
    192192
    193     def tearDown(self):
    194         self.client.logout()
    195 
    196193    def test_changelist_ForeignKey(self):
    197194        response = self.client.get('/admin_widgets/car/')
    198195        self.assertContains(response, '/auth/user/add/')
    class AdminForeignKeyRawIdWidget(DjangoTestCase): 
    206203    def setUp(self):
    207204        self.client.login(username="super", password="secret")
    208205
    209     def tearDown(self):
    210         self.client.logout()
    211 
    212206    def test_nonexistent_target_id(self):
    213207        band = models.Band.objects.create(name='Bogey Blues')
    214208        pk = band.pk
  • tests/generic_inline_admin/tests.py

    diff --git a/tests/generic_inline_admin/tests.py b/tests/generic_inline_admin/tests.py
    index 0d69757..3e24168 100644
    a b class GenericAdminViewTest(TestCase): 
    4141        m.save()
    4242        self.png_media_pk = m.pk
    4343
    44     def tearDown(self):
    45         self.client.logout()
    46 
    4744    def test_basic_add_GET(self):
    4845        """
    4946        A smoke test to ensure GET on the add_view works.
    class GenericInlineAdminParametersTest(TestCase): 
    137134        self.client.login(username='super', password='secret')
    138135        self.factory = RequestFactory()
    139136
    140     def tearDown(self):
    141         self.client.logout()
    142 
    143137    def _create_object(self, model):
    144138        """
    145139        Create a model with an attached Media object via GFK. We can't
    class GenericInlineAdminWithUniqueTogetherTest(TestCase): 
    286280    def setUp(self):
    287281        self.client.login(username='super', password='secret')
    288282
    289     def tearDown(self):
    290         self.client.logout()
    291 
    292283    def test_add(self):
    293284        category_id = Category.objects.create(name='male').pk
    294285        post_data = {
  • tests/test_client_regress/tests.py

    diff --git a/tests/test_client_regress/tests.py b/tests/test_client_regress/tests.py
    index 0d63ee9..33d7c95 100644
    a b class SessionTests(TestCase): 
    10621062        login = self.client.login(username='testclient', password='password')
    10631063        self.assertTrue(login, 'Could not log in')
    10641064        self.client.logout()
    1065         self.client.logout()
    10661065
    10671066    def test_logout_with_user(self):
    10681067        """Logout should send user_logged_out signal if user was logged in."""
Back to Top