#NEWLINE# def test_mixed_update_translations( self ) : #NEWLINE# #INDENT# instance = Normal . objects . language ( 'en' ) . get ( pk = self . normal_id [ 1 ] ) #NEWLINE# Formset = translationformset_factory ( Normal , extra = 1 , exclude = [ ] ) #NEWLINE# initial = Formset ( instance = instance ) #NEWLINE# data = FormData ( initial ) #NEWLINE# data . set_formset_field ( initial , 0 , 'DELETE' , 'DELETE' ) #NEWLINE# data . set_formset_field ( initial , 1 , 'translated_field' , 'updated_ja' ) #NEWLINE# data . set_formset_field ( initial , 2 , 'language_code' , 'de' ) #NEWLINE# data . set_formset_field ( initial , 2 , 'translated_field' , 'Deutsch' ) #NEWLINE# formset = Formset ( data = data , instance = instance ) #NEWLINE# self . assertTrue ( formset . is_valid ( ) ) #NEWLINE# formset . save ( ) #NEWLINE# self . assertCountEqual ( instance . get_available_languages ( ) , ( 'ja' , 'de' ) ) #NEWLINE# obj = Normal . objects . language ( 'ja' ) . get ( pk = instance . pk ) #NEWLINE# self . assertEqual ( obj . shared_field , NORMAL [ 1 ] . shared_field ) #NEWLINE# self . assertEqual ( obj . translated_field , 'updated_ja' ) #NEWLINE# obj = Normal . objects . language ( 'de' ) . get ( pk = instance . pk ) #NEWLINE# self . assertEqual ( obj . shared_field , NORMAL [ 1 ] . shared_field ) #NEWLINE# self . assertEqual ( obj . translated_field , 'Deutsch' )