text: import random
  
  from model.models import Group
  from random import randrange
  
  
  def test_modify_group_name(app, db, check_ui):
      if len(db.get_group_list()) == 0:
          app.group.create(Group(name="test"))
      old_groups = db.get_group_list()
      index = randrange(len(old_groups))
      group = old_groups[index]
      group_modify = Group(name="New group")
      group_modify.id = old_groups[index].id
      app.group.modify_group_by_id(group.id, group_modify)
      new_groups = db.get_group_list()
      assert sorted(old_groups, key=Group.id_or_max) == sorted(new_groups, key=Group.id_or_max)
      if check_ui:
          assert sorted(new_groups, key=Group.id_or_max) == sorted(app.group.get_group_list(), key=Group.id_or_max)
  
  