              Permission.objects.get(codename='change_basicmodel'),
              Permission.objects.get(codename='delete_basicmodel')
          ])
          user = User.objects.create_user('updateonly', 'updateonly@example.com', 'password')
          set_many(user, 'user_permissions', [
              Permission.objects.get(codename='change_basicmodel'),
          ])
  
          self.permitted_credentials = basic_auth_header('permitted', 'password')
          self.disallowed_credentials = basic_auth_header('disallowed', 'password')
 
</s> remove         set_many(user, 'user_permissions', [
 </s> add         user.user_permissions.set([ </s> remove         if is_authenticated(request.user):
 </s> add         if request.user.is_authenticated: </s> remove     for manager_name, manager_instance in get_names_and_managers(opts):
 </s> add     names_and_managers = [
        (manager.name, manager)
        for manager
        in opts.managers
    ]
    for manager_name, manager_instance in names_and_managers: </s> remove         return template_render(template, context)
 </s> add         return template.render(context) </s> remove         return template_render(template, context)
 </s> add         return template.render(context)
        user.user_permissions.set([
              Permission.objects.get(codename='change_basicmodel'),
              Permission.objects.get(codename='delete_basicmodel')
          ])
          user = User.objects.create_user('updateonly', 'updateonly@example.com', 'password')
        user.user_permissions.set([
              Permission.objects.get(codename='change_basicmodel'),
          ])
  
          self.permitted_credentials = basic_auth_header('permitted', 'password')
          self.disallowed_credentials = basic_auth_header('disallowed', 'password')
keep keep keep keep replace keep keep keep keep keep
 Remove Django 1.8 & 1.9 compatibility code (#5481)

* Identify code that needs to be pulled out of/removed from compat.py

* Extract modern code from get_names_and_managers in compat.py and remove compat code

* Extract modern code from is_authenticated() in compat.py and remove.

* Extract modern code from is_anonymous() in compat.py and remove

* Extract modern code from get_related_model() from compat.py and remove

* Extract modern code from value_from_object() in compat.py and remove

* Update postgres compat

JSONField now always available.

* Remove DecimalValidator compat

* Remove get_remote_field compat

* Remove template_render compat

Plus isort.

* Remove set_many compat

* Remove include compat 
tests/test_permissions.py