Cleanup EmailMessage types (#208)

* Cleanup EmailMessage types

* Typecheck email module tests.
This commit is contained in:
Konstantin Alekseev
2019-12-01 17:14:16 +03:00
committed by Maksim Kurnikov
parent f824003cc4
commit c0c5d1e588
8 changed files with 70 additions and 23 deletions

View File

@@ -5,7 +5,7 @@ import re
IGNORED_MODULES = {'schema', 'gis_tests', 'admin_widgets', 'admin_filters', 'migrations',
'sitemaps_tests', 'staticfiles_tests', 'modeladmin', 'model_forms',
'generic_views', 'forms_tests', 'flatpages_tests', 'admin_utils',
'admin_ordering', 'admin_changelist', 'admin_views', 'mail', 'redirects_tests',
'admin_ordering', 'admin_changelist', 'admin_views', 'redirects_tests',
'invalid_models_tests', 'i18n', 'migrate_signals', 'model_formsets',
'template_tests', 'template_backends', 'test_runner', 'admin_scripts',
'sites_tests', 'inline_formsets', 'foreign_object', 'cache', 'test_client', 'test_client_regress'}
@@ -227,6 +227,17 @@ IGNORED_ERRORS = {
"Cannot resolve keyword 'porcupine' into field",
'Argument 1 to "set" of "RelatedManager" has incompatible type "int"',
],
'mail': [
'List item 1 has incompatible type "None"; expected "str"',
'Incompatible return value type (got "None", expected "bool")',
'Argument 1 to "push" of "SMTPChannel" has incompatible type "str"; expected "bytes"',
'Value of type "Union[List[Message], str, bytes, None]" is not indexable',
'Incompatible types in assignment '
+ '(expression has type "bool", variable has type "Union[SMTP_SSL, SMTP, None]")',
re.compile(
r'Item "(int|str)" of "Union\[Message, str, int, Any\]" has no attribute "(get_content_type|get_filename)"'
)
],
'messages_tests': [
'List item 0 has incompatible type "Dict[str, Message]"; expected "Message"',
'Too many arguments',