Skip to content

Commit

Permalink
Add tests to ensure this is working without the plugin
Browse files Browse the repository at this point in the history
A bit of a hacky solution for now, maybe CI could be improved to
add this kind of tests more easily.
`var-annotated` is still an ignored error code as I wasn't able
to change the assignment to an annotation for `ManyToManyField`s
in my previous commit
  • Loading branch information
Viicos committed Feb 2, 2024
1 parent 1f1f04d commit a075b0b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/typecheck/fields/test_base.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
- case: test_model_fields_classes_present_as_primitives
parametrized:
- mypy_section: |
[mypy]
plugins =
mypy_django_plugin.main
- mypy_section: |
[mypy]
disable_error_code = var-annotated
plugins =
mypy_config: |
{{ mypy_section }}
main: |
from myapp.models import User
user = User(small_int=1, name='user', slug='user', text='user')
Expand Down Expand Up @@ -75,6 +86,17 @@
my_pk = models.IntegerField(primary_key=True)
- case: blank_and_null_char_field_allows_none
parametrized:
- mypy_section: |
[mypy]
plugins =
mypy_django_plugin.main
- mypy_section: |
[mypy]
disable_error_code = var-annotated
plugins =
mypy_config: |
{{ mypy_section }}
main: |
from myapp.models import MyModel
MyModel(nulltext="")
Expand Down

0 comments on commit a075b0b

Please sign in to comment.