diff --git a/db/dbtest/db.go b/db/dbtest/db.go
index <HASH>..<HASH> 100644
--- a/db/dbtest/db.go
+++ b/db/dbtest/db.go
@@ -15,19 +15,30 @@ import (
 // ClearAllCollections removes all registers from all collections in the given
 // Mongo database.
 func ClearAllCollections(db *mgo.Database) error {
+	return ClearAllCollectionsExcept(db, nil)
+}
+
+func ClearAllCollectionsExcept(db *mgo.Database, toKeep []string) error {
 	colls, err := db.CollectionNames()
 	if err != nil {
 		return err
 	}
 	for _, collName := range colls {
+		var coll *mgo.Collection
 		if strings.Index(collName, "system.") != -1 {
 			continue
 		}
-		coll := db.C(collName)
+		for i := range toKeep {
+			if collName == toKeep[i] {
+				goto next
+			}
+		}
+		coll = db.C(collName)
 		_, err = coll.RemoveAll(nil)
 		if err != nil {
 			coll.DropCollection()
 		}
+	next:
 	}
 	return nil
 }
db/dbtest: func to clear all collections except specified ones