#NEWLINE# @ run_with_all_backends #NEWLINE# def test_process_repeat_record_locking( self ) : #NEWLINE# #INDENT# self . assertEqual ( len ( RepeatRecord . all ( ) ) , 2 ) #NEWLINE# with patch ( 'corehq.apps.repeaters.tasks.process_repeat_record' ) as mock_process : #NEWLINE# #INDENT# check_repeaters ( ) #NEWLINE# self . assertEqual ( mock_process . delay . call_count , 2 ) #NEWLINE# #UNINDENT# with patch ( 'corehq.apps.repeaters.tasks.process_repeat_record' ) as mock_process : #NEWLINE# #INDENT# check_repeaters ( ) #NEWLINE# self . assertEqual ( mock_process . delay . call_count , 0 ) #NEWLINE# #UNINDENT# records = RepeatRecord . all ( ) #NEWLINE# for record in records : #NEWLINE# #INDENT# record . save ( ) #NEWLINE# #UNINDENT# with patch ( 'corehq.apps.repeaters.tasks.process_repeat_record' ) as mock_process : #NEWLINE# #INDENT# check_repeaters ( ) #NEWLINE# self . assertEqual ( records . delay . call_count , 2 )