def test4(self):
    account_key = "a@a.a"
    trophy_case_widget = TrophyCase(key_name=account_key)
    points_widget = Points(key_name=account_key)
    rank_widget = Rank(key_name=account_key)
    newacc = Accounts(key_name=account_key,
                     password="aaa",
                     email="a@a.a",
                     isEnabled="enabled",
                     accountType="bronze",
                     paymentType="free",
                     apiKey="xxx",
                     cookieKey="xxx",
                     trophyWidget=trophy_case_widget,
                     pointsWidget=points_widget, 
                     rankWidget=rank_widget)
    try:
      memcache_db.delete_entity(newacc, key)
    except Exception:
      pass

    # Save an account
    ret = memcache_db.save_entity(newacc, account_key)

    user_key = "testuser1"
    newuser = Users(key_name=user_key,
                   userid=user_key,
                   isEnabled="yes",
                   accountRef=newacc,
                   tags = user_key)
    try:
      memcache_db.delete_entity(newacc, user_key)
    except Exception:
      pass
    # Save a user
    ret = memcache_db.save_entity(newacc, user_key)

    # Create a Badge Type
    badge_key = "testbadge1"
    badgetype = Badges(key_name=badge_key,
                    name="badge1",
                    description=badge_key,
                    altText="a really cool badge", 
                    setType="free",
                    isEnabled="yes",
                    creator=newacc,
                    permissions="private",
                    storageType="blob",
                    blobKey="xxxx") 
    try:
      memcache_db.delete_entity(badgetype, badge_key)
    except Exception:
      pass
    # Save and get saved ent
    ret = memcache_db.save_entity(badgetype, badge_key)