@pytest.mark.django_db
def test_update_unit_order(project0_nongnu, ordered_po, ordered_update_ttk):
 ordered_po.sync()
 assert ordered_po.file.exists()
 old_unit_list = ['1->2', '2->4', '3->3', '4->5']
 updated_unit_list = list([unit.unitid for unit in ordered_po.units])
 assert (old_unit_list == updated_unit_list)
 current_revision = ordered_po.get_max_unit_revision()
 ordered_po.update(ordered_update_ttk, store_revision=current_revision)
 old_unit_list = ['X->1', '1->2', '3->3', '2->4', '4->5', 'X->6', 'X->7', 'X->8']
 updated_unit_list = list([unit.unitid for unit in ordered_po.units])
 assert (old_unit_list == updated_unit_list)

@ pytest . mark . django_db def test_update_unit_order ( project0_nongnu , ordered_po , ordered_update_ttk ) : ordered_po . sync ( ) assert ordered_po . file . exists ( ) old_unit_list = [ '1->2' , '2->4' , '3->3' , '4->5' ] updated_unit_list = list ( [ unit . unitid for unit in ordered_po . units ] ) assert ( old_unit_list == updated_unit_list ) current_revision = ordered_po . get_max_unit_revision ( ) ordered_po . update ( ordered_update_ttk , store_revision = current_revision ) old_unit_list = [ 'X->1' , '1->2' , '3->3' , '2->4' , '4->5' , 'X->6' , 'X->7' , 'X->8' ] updated_unit_list = list ( [ unit . unitid for unit in ordered_po . units ] ) assert ( old_unit_list == updated_unit_list )
tests unit order after a specific update .