Changes between Version 41 and Version 48 of Ticket #18586


Ignore:
Timestamp:
Dec 3, 2014, 6:13:59 PM (9 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18586

    • Property Status assignednew
  • Ticket #18586 – Description

    v41 v48  
    11There's quite a lot of unit tests that have been rewritten 1:1 from doctests. These tests tend to verify all aspects of a certain feature at once, they modify the state of the database throughout the whole test and by the end of the test no one really knows what the database state is supposed to be.
    22
    3 For example, `modeltests.generic_relations.GenericRelationsTests.test_generic_relations` walks through most of the features supported by `GenericForeignKeys`, it is 130 lines long and in case the last assertion fails, you'll have to spend ridiculous amounts of time figuring out what happened.
     3For example, `tests.generic_relations.GenericRelationsTests.test_generic_relations` walks through most of the features supported by `GenericForeignKeys`, it is 130 lines long and in case the last assertion fails, you'll have to spend ridiculous amounts of time figuring out what happened.
    44
    5 A likely incomplete list of similar tests:[[BR]]
    6 ~~modeltests.basic.ModelTest.test_lookup~~[[BR]]
    7 ~~`modeltests.basic.ModelTest.test_object_creation`~~[[BR]]
    8 ~~modeltests.custom_columns.CustomColumnsTests.test_db_column~~[[BR]]
    9 ~~modeltests.custom_managers.CustomManagerTests.test_manager~~[[BR]]
    10 ~~modeltests.custom_pk.CustomPKTests.test_custom_pk~~[[BR]]
    11 `modeltests.defer.DeferTests.test_defer`[[BR]]
    12 `modeltests.expressions.ExpressionsTests.test_filter`[[BR]]
    13 `modeltests.field_subclassing.CustomField.test_custom_field`[[BR]]
    14 `modeltests.files.FileStorageTests.test_files`[[BR]]
    15 ~~modeltests.get_or_create.GetOrCreateTests.test_get_or_create~~[[BR]]
    16 ~~modeltests.m2m_recursive.RecursiveM2MTests.test_recursive_m2m~~[[BR]]
    17 `modeltests.m2m_signals.ManyToManySignalsTest`[[BR]]
    18 ~~modeltests.m2m_through.M2mThroughTests~~[[BR]]
    19 `modeltests.m2m_through_regress.M2MThroughTestCase`[[BR]]
    20 `modeltests.model_formsets.ModelFormsetTests`[[BR]]
    21 `modeltests.model_forms.OldFormForXTests.test_with_data` (This one has more than 500 lines!)[[BR]]
    22 `modeltests.model_inheritance.ModelInheritanceTests`[[BR]]
    23 `modeltests.model_package.ModelPackageTests.test_model_packages`[[BR]]
    24 `modeltests.order_with_respect_to.OrderWithRespectToTests.test_basic`[[BR]]
    25 ~~`modeltests.signals.SignalTests.test_basic`~~
    26 
    27 I only went through modeltests/*/tests.py; I might have overlooked a few tests.
     5A likely incomplete list of similar tests:
     6~~tests.basic.ModelTest.test_lookup~~
     7~~tests.basic.ModelTest.test_object_creation~~
     8~~tests.custom_columns.CustomColumnsTests.test_db_column~~
     9~~tests.custom_managers.CustomManagerTests.test_manager~~
     10~~tests.custom_pk.CustomPKTests.test_custom_pk~~
     11`tests.defer.DeferTests.test_defer`
     12~~tests.expressions.ExpressionsTests.test_filter~~
     13~~tests.field_subclassing.CustomField.test_custom_field~~ (deprecated)
     14~~tests.get_or_create.GetOrCreateTests.test_get_or_create~~
     15~~tests.m2m_recursive.RecursiveM2MTests.test_recursive_m2m~~
     16`tests.m2m_signals.ManyToManySignalsTest`
     17~~tests.m2m_through.M2mThroughTests~~
     18`tests.m2m_through_regress.M2MThroughTestCase`
     19~~tests.model_inheritance.ModelInheritanceTests~~
     20~~tests.model_package.ModelPackageTests.test_model_packages~~
     21~~tests.order_with_respect_to.OrderWithRespectToTests.test_basic~~
     22~~tests.signals.SignalTests.test_basic~~
    2823
    2924This ticket is meant to track all of them; each time a test is updated, we can strike it out in the list above and once there is no item left, we can close this. The point is to make the test suite help developers as much as possible.
Back to Top