Your GQL is OK, though you should do a keys only query as it is more efficient.
db.delete(db.GqlQuery("SELECT __key__ FROM TEST WHERE type = :1", "TEST"))
Using a filter it should be
testList = Test.all(keys_only=True)
db.delete(testList.filter("type = ", "TEST"))
You will find that for large numbers of records in production this approach won't scale. Trying to do this in a web request with many thousands of entities will more than likely end up with a DeadlineExceededError.
If you run the delete in a task you will get 10 minutes to complete your request, if the you really large numbers even this won't work.
If you are just trying to clear the dev datastore use the command line for clearing the datastore on dev server startup.
Some other things to consider.
If you are just starting out, switch to ndb. You should protect such a web method with with some sort of authentication/access control. Consider learning about REST and methodology. Normally requests that mutate shouldn't be done with a GET, but use DELETE or POST. - just some things to consider.