
    h                     :    d dl mZmZmZ d dlmZ  G d de      Zy)   )(ManyToManyAndOtherFieldsTranslationModel$ManyToManyOnlyFieldsTranslationModelRegularModel)AppTestCasec                   4     e Zd Ze fd       Zd Zd Z xZS )ModelManyToManyTestCasec                     t         |           t        j                  j	                  d      | _        t        j                  j	                  d      | _        y )NOne)original_fieldTwo)supersetUpTestDatar   objectscreateregular_oneregular_two)cls	__class__s    T/home/dcms/DCMS/lib/python3.12/site-packages/parler/tests/test_model_many_to_many.pyr   z%ModelManyToManyTestCase.setUpTestData
   sD    &..55U5K&..55U5K    c                    t         j                  j                  d      }|j                  d       |j	                  d       |j
                  j                  | j                  g       |j                          | j                  t         j                  j                  d      j                         j
                  j                         d   | j                         |j                  d       |j	                  d       |j
                  j                  | j                  g       |j                          | j                  t         j                  j                  d      j                         j
                  j                         d   | j                         | j                  t         j                  j                  d      j                         j
                  j                         d   | j                         y)<Test a model that has *only* translated many to many fields.r
   shareden    frnlN)r   r   r   set_current_languagecreate_translationtranslated_many_to_manysetr   saveassertEquallanguagefirstallr   selfobjs     r   test_save_many_to_many_onlyz3ModelManyToManyTestCase.test_save_many_to_many_only   sz   2::AAAO 	  &t$##'')9)9(:;
088AA$GUW$$SSU1. 		
 	  &t$##'')9)9(:;
088AA$GUW$$SSU1. 		
 	088AA$GUW$$SSU1. 		
r   c                    t         j                  j                  d      }|j                  d       d|_        |j                          |j                  j                  | j                  g       |j                          | j                  t         j                  j                  d      j                         j                  j                         d   | j                         |j                  d       d|_        |j                          |j                  j                  | j                  g       |j                          | j                  t         j                  j                  d      j                         j                  j                         d   | j                         | j                  t         j                  j                  d      j                         j                  j                         d   | j                         y	)
r   r
   r   r   Englishr   r   Frenchr   N)r   r   r   r   tr_titler#   r!   r"   r   r$   r%   r&   r'   r   r(   s     r   'test_save_many_to_many_and_other_fieldsz?ModelManyToManyTestCase.test_save_many_to_many_and_other_fields4   s~   6>>EEUES 	  & 
##'')9)9(:;
4<<EEdKUW$$SSU1. 		
 	  &
##'')9)9(:;
4<<EEdKUW$$SSU1. 		
 	4<<EEdKUW$$SSU1. 		
r   )__name__
__module____qualname__classmethodr   r+   r0   __classcell__)r   s   @r   r   r   	   s"    L L
"
H$
r   r   N)testapp.modelsr   r   r   utilsr   r    r   r   <module>r9      s"    
 O
k O
r   