+
    Vj                     &    ^ RI Ht  ! R R4      tR# )    )modelsc                   V   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
tV tR# )TestFieldOptionsc                |    \         P                  P                  P                  R4      pVP                  RJ g   Q hR# )zLfield_options entry for a specific language is set on that language's field.title_enTNr   FieldOptionsModel_meta	get_fielddb_index)selffields   & ^/var/www/idalgo/venv/lib/python3.14/site-packages/modeltranslation/tests/test_field_options.py%test_explicit_language_option_applied6TestFieldOptions.test_explicit_language_option_applied   s0    ((..88D~~%%%    c                    \         P                  P                  P                  R4      P                  RJ g   Q h\         P                  P                  P                  R4      P                  RJ g   Q hR# )z=The 'default' key applies to languages not explicitly listed.title_deFsub_title2_enTNr   r   s   &r   0test_default_option_applied_to_unlisted_languageATestFieldOptions.test_default_option_applied_to_unlisted_language
   sZ    ''--77
CLLPUUUU''--77HQQUYYYYr   c                   \         P                  P                  P                  R4      P                  RJ g   Q h\         P                  P                  P                  R4      P                  RJ g   Q h\         P                  P                  P                  R4      P                  RJ g   Q h\         P                  P                  P                  R4      P                  RJ g   Q hR# )z?An explicit language entry must take precedence over 'default'.r   Tr   Fsub_title2_der   Nr   r   s   &r   (test_explicit_language_wins_over_default9TestFieldOptions.test_explicit_language_wins_over_default   s    ''--77
CLLPTTTT''--77
CLLPUUUU''--77HQQUZZZZ''--77HQQUYYYYr   c                x    \         P                  P                  P                  R4      P                  RJ g   Q hR# )z:field_options works independently for each declared field.sub_title1_deTNr   r   s   &r   "test_field_options_on_second_field3TestFieldOptions.test_field_options_on_second_field   s.    ''--77HQQUYYYYr   c                x    \         P                  P                  P                  R4      P                  RJ g   Q hR# )zLWhen there is no explicit entry and no 'default', the field is not modified.sub_title1_enFNr   r   s   &r   3test_unlisted_language_without_default_is_unchangedDTestFieldOptions.test_unlisted_language_without_default_is_unchanged   s0     ''--77HQQUZZZZr   c                    \         P                  P                  P                  R4      pVP	                  4       w  r#rERV9   g   Q hVR,          RJ g   Q hR# )zLdeconstruct() must expose per-language options so migrations serialise them.r   r   TNr   r	   r
   r   deconstructr   r   _name_path_argskwargss   &     r   ,test_deconstruct_includes_per_language_kwarg=TestFieldOptions.test_deconstruct_includes_per_language_kwarg   sR    ((..88D&+&7&7&9#eV###j!T)))r   c                    \         P                  P                  P                  R4      pVP	                  4       w  r#rERV9   g   Q hVR,          RJ g   Q hR# )zPThe field carrying the 'default' option also appears correctly in deconstruct().r   r   FNr&   r(   s   &     r   'test_deconstruct_default_kwarg_included8TestFieldOptions.test_deconstruct_default_kwarg_included&   sR    ((..88D&+&7&7&9#eV###j!U***r   c                    \         P                  P                  P                  R4      pVP	                  4       w  r#rERV9  g   Q hR# )zSFields on models without field_options must not gain extra kwargs in deconstruct().r   r   N)r   	TestModelr
   r   r'   r(   s   &     r   6test_deconstruct_no_extra_kwargs_without_field_optionsGTestFieldOptions.test_deconstruct_no_extra_kwargs_without_field_options-   s?      &&00<&+&7&7&9#e'''r   c                    \         P                  P                  P                  R4      p\         P                  P                  P                  R4      pVP                  VP                  8X  g   Q hR# )z?Models that don't use field_options continue to work as before.r   r   N)r   r3   r
   r   r   )r   field_enfield_des   &  r   +test_model_without_field_options_unaffected<TestFieldOptions.test_model_without_field_options_unaffected3   sT    ##))33J?##))33J?  H$5$5555r    N)__name__
__module____qualname____firstlineno__r   r   r   r   r#   r-   r0   r4   r9   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s;     &
Z
ZZ[
*+(6 6r   r   N)modeltranslation.testsr   r   r;   r   r   <module>rD      s    )36 36r   