input: Write a python function to add 'blog_app' to the INSTALLED_APPS list in a Django settings file.
  assert add_to_installed_apps('INSTALLED_APPS = [\n    \'django.contrib.admin\',\n    \'django.contrib.auth\',\n    \'django.contrib.contenttypes\',\n    \'django.contrib.sessions\',\n    \'django.contrib.messages\',\n    \'django.contrib.staticfiles\',\n]\n') == 'INSTALLED_APPS = [\n    \'django.contrib.admin\',\n    \'django.contrib.auth\',\n    \'django.contrib.contenttypes\',\n    \'django.contrib.sessions\',\n    \'django.contrib.messages\',\n    \'django.contrib.staticfiles\',\n    \'blog_app\',\n]\n'
  assert add_to_installed_apps('INSTALLED_APPS = [\n]\n') == 'INSTALLED_APPS = [\n    \'blog_app\',\n]\n'
output: def add_to_installed_apps(settings):
      lines = settings.split('\n')
      for i, line in enumerate(lines):
          if line.strip() == ']':
              lines.insert(i, "    'blog_app',")
              break
      return '\n'.join(lines)