anchor.diff:          get_base_url(), "/", ?b2l(AuthDb), "/org.couchdb.user:", Name]),
       {ok, 201, _, _} = do_request(put, Url, Body),
       % let's proceed after giving couchdb_peruser some time to create the user db
  -    timer:sleep(50).
  +    timer:sleep(1000).
   
   delete_user(AuthDb, Name) ->
       Url = lists:concat([get_base_url(), "/", ?b2l(AuthDb),
  
positive.code:     set_config("couchdb_peruser", "enable", "false"),
      set_config("couchdb_peruser", "delete_dbs", "false"),
      do_request(delete, get_base_url() ++ "/" ++ ?b2l(TestAuthDb)),
      config:delete("admins", ?ADMIN_USERNAME).
  
  set_config(Section, Key, Value) ->
  
negative.code:     set_config("couchdb_peruser", "enable", "false"),
      create_user(TestAuthDb, User),
      ?_assert(not lists:member(UserDbName, all_dbs())).
  
  should_assign_user_to_db_admins(TestAuthDb) ->
      User = "qux",
      UserDbName = <<"userdb-717578">>,
      create_user(TestAuthDb, User),
      ?_assertEqual(
          {[{<<"names">>,[<<"qux">>]}]},
          proplists:get_value(<<"admins">>, get_security(UserDbName))).
  
  should_assign_user_to_db_members(TestAuthDb) ->
      User = "qux",
      UserDbName = <<"userdb-717578">>,
      create_user(TestAuthDb, User),
      ?_assertEqual(
          {[{<<"names">>,[<<"qux">>]}]},
          proplists:get_value(<<"members">>, get_security(UserDbName))).
  
  should_not_remove_existing_db_admins(TestAuthDb) ->
      User = "qux",
      UserDbName = <<"userdb-717578">>,
      SecurityProperties = [
          {<<"admins">>,{[{<<"names">>,[<<"foo">>,<<"bar">>]}]}},
          {<<"members">>,{[{<<"names">>,[<<"baz">>,<<"pow">>]}]}}
      ],
      create_db(UserDbName),
      set_security(UserDbName, SecurityProperties),
      create_user(TestAuthDb, User),
      {AdminProperties} = proplists:get_value(<<"admins">>,
          get_security(UserDbName)),
      AdminNames = proplists:get_value(<<"names">>, AdminProperties),
      ?_assert(lists:member(<<"foo">>, AdminNames)),
      ?_assert(lists:member(<<"bar">>, AdminNames)),
      ?_assert(lists:member(<<"qux">>, AdminNames)).
  
  should_not_remove_existing_db_members(TestAuthDb) ->
      User = "qux",
      UserDbName = <<"userdb-717578">>,
      SecurityProperties = [
          {<<"admins">>,{[{<<"names">>,[<<"pow">>,<<"wow">>]}]}},
          {<<"members">>,{[{<<"names">>,[<<"pow">>,<<"wow">>]}]}}
      ],
      create_db(UserDbName),
      set_security(UserDbName, SecurityProperties),
      create_user(TestAuthDb, User),
      {MemberProperties} = proplists:get_value(<<"members">>,
          get_security(UserDbName)),
      MemberNames = proplists:get_value(<<"names">>, MemberProperties),
      ?_assert(lists:member(<<"pow">>, MemberNames)),
      ?_assert(lists:member(<<"wow">>, MemberNames)),
      ?_assert(lists:member(<<"qux">>, MemberNames)).
  
  couchdb_peruser_test_() ->
      {
  