func (t *TestSuite) AssertNotContains(s string) {
	if bytes.Contains(t.Response.Body.Bytes(), []byte(s)) {
		panic(fmt.Errorf("Assertion failed. Expected response not to contain %s", s))
	}
}
AssertNotContains asserts that the response does not contain the given string.
package testsuite
import (
	"bytes"
	"fmt"
	"github.com/revel/revel"
	"github.com/revel/revel/session"
	"golang.org/x/net/websocket"
	"io"
	"mime"
	"mime/multipart"
	"net/http"
	"net/http/cookiejar"
	"net/http/httptest"
	"net/textproto"
	"net/url"
	"os"
	"path/filepath"
	"regexp"
	"strings"
	"testing"
)
func NewTestSuite(t *testing.T) *TestSuite {
	return NewTestSuiteEngine(revel.NewSessionCookieEngine(), t)
}
func NewTestSuiteEngine(engine revel.SessionEngine, t *testing.T) *TestSuite {
	jar, _ := cookiejar.New(nil)
	ts := &TestSuite{
		Client:        &http.Client{Jar: jar},
		Session:       session.NewSession(),
		SessionEngine: engine,
		T:             t,
		ResponseChannel:make(chan bool, 1),
	}
	return ts
}
type TestSuite struct {
	Response        *httptest.ResponseRecorder  
	ResponseChannel chan bool                   
	Session         session.Session             
	SessionEngine   revel.SessionEngine         
	Sent            bool                        
	T               *testing.T                  
	Client          *http.Client                
}
func (t *TestSuite) NewTestRequest(req *http.Request) *TestRequest {
	return &TestRequest{
		Request:   req,
		testSuite: t,
	}
}
func (t *TestSuite) Host() string {
	if revel.ServerEngineInit.Address[0] == ':' {
		return "127.0.0.1" + revel.ServerEngineInit.Address
	}
	return revel.ServerEngineInit.Address
}
func (t *TestSuite) BaseUrl() string {
	if revel.HTTPSsl {
		return "https://" + t.Host()
	}
	return "http://" + t.Host()
}
func (t *TestSuite) WebSocketUrl() string {
	return "ws://" + t.Host()
}
func (t *TestSuite) Get(path string) *TestSuite {
	t.GetCustom(t.BaseUrl() + path).Send()
	return t
}
func (t *TestSuite) GetCustom(uri string) *TestRequest {
	req, err := http.NewRequest("GET", uri, nil)
	if err != nil {
		panic(err)
	}
	return t.NewTestRequest(req)
}
func (t *TestSuite) Delete(path string) {
	t.DeleteCustom(t.BaseUrl() + path).Send()
}
func (t *TestSuite) DeleteCustom(uri string) *TestRequest {
	req, err := http.NewRequest("DELETE", uri, nil)
	if err != nil {
		panic(err)
	}
	return t.NewTestRequest(req)
}
func (t *TestSuite) Put(path string, contentType string, reader io.Reader) {
	t.PutCustom(t.BaseUrl()+path, contentType, reader).Send()
}
func (t *TestSuite) PutCustom(uri string, contentType string, reader io.Reader) *TestRequest {
	req, err := http.NewRequest("PUT", uri, reader)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Content-Type", contentType)
	return t.NewTestRequest(req)
}
func (t *TestSuite) PutForm(path string, data url.Values) *TestSuite {
	t.PutFormCustom(t.BaseUrl()+path, data).Send()
	return t
}
func (t *TestSuite) PutFormCustom(uri string, data url.Values) *TestRequest {
	return t.PutCustom(uri, "application/x-www-form-urlencoded", strings.NewReader(data.Encode()))
}
func (t *TestSuite) Patch(path string, contentType string, reader io.Reader) *TestSuite {
	t.PatchCustom(t.BaseUrl()+path, contentType, reader).Send()
	return t
}
func (t *TestSuite) PatchCustom(uri string, contentType string, reader io.Reader) *TestRequest {
	req, err := http.NewRequest("PATCH", uri, reader)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Content-Type", contentType)
	return t.NewTestRequest(req)
}
func (t *TestSuite) Post(path string, contentType string, reader io.Reader) *TestSuite {
	t.PostCustom(t.BaseUrl()+path, contentType, reader).Send()
	return t
}
func (t *TestSuite) PostCustom(uri string, contentType string, reader io.Reader) *TestRequest {
	req, err := http.NewRequest("POST", uri, reader)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Content-Type", contentType)
	return t.NewTestRequest(req)
}
func (t *TestSuite) PostForm(path string, data url.Values) *TestSuite {
	t.PostFormCustom(t.BaseUrl()+path, data).Send()
	return t
}
func (t *TestSuite) PostFormCustom(uri string, data url.Values) *TestRequest {
	return t.PostCustom(uri, "application/x-www-form-urlencoded", strings.NewReader(data.Encode()))
}
func (t *TestSuite) PostFile(path string, params url.Values, filePaths url.Values) *TestSuite {
	t.PostFileCustom(t.BaseUrl()+path, params, filePaths).Send()
	return t
}
func (t *TestSuite) PostFileCustom(uri string, params url.Values, filePaths url.Values) *TestRequest {
	body := &bytes.Buffer{}
	writer := multipart.NewWriter(body)
	for key, values := range filePaths {
		for _, value := range values {
			createFormFile(writer, key, value)
		}
	}
	for key, values := range params {
		for _, value := range values {
			err := writer.WriteField(key, value)
			t.AssertEqual(nil, err)
		}
	}
	err := writer.Close()
	t.AssertEqual(nil, err)
	return t.PostCustom(uri, writer.FormDataContentType(), body)
}
func (r *TestRequest) Send() *TestRequest {
	writer := httptest.NewRecorder()
	context := revel.NewGoContext(nil)
	context.Request.SetRequest(r.Request)
	context.Response.SetResponse(writer)
	controller := revel.NewController(context)
	controller.Session = r.testSuite.Session
	r.testSuite.SessionEngine.Encode(controller)
	response := http.Response{Header: writer.Header()}
	cookies := response.Cookies()
	for _, c := range cookies {
		r.AddCookie(c)
	}
	r.MakeRequest()
	return r
}
func (r *TestRequest) MakeRequest() *TestRequest {
	revel.CurrentEngine.(*GoHttpServer).TestChannel <- r
	<-r.testSuite.ResponseChannel
	r.Sent = true
	context := revel.NewGoContext(nil)
	newRequest := &http.Request{URL: r.URL, Header: r.testSuite.Response.Header()}
	for _, cookie := range r.testSuite.Client.Jar.Cookies(r.Request.URL) {
		newRequest.AddCookie(cookie)
	}
	context.Request.SetRequest(newRequest)
	context.Response.SetResponse(httptest.NewRecorder())
	controller := revel.NewController(context)
	r.testSuite.SessionEngine.Decode(controller)
	r.testSuite.Session = controller.Session
	return r
}
func (t *TestSuite) WebSocket(path string) *websocket.Conn {
	t.Assertf(true, "Web Socket Not implemented at this time")
	origin := t.BaseUrl() + "/"
	url := t.WebSocketUrl() + path
	ws, err := websocket.Dial(url, "", origin)
	if err != nil {
		panic(err)
	}
	return ws
}
func (t *TestSuite) AssertOk() {
	t.AssertStatus(http.StatusOK)
}
func (t *TestSuite) AssertNotFound() {
	t.AssertStatus(http.StatusNotFound)
}
func (t *TestSuite) AssertStatus(status int) {
	if t.Response.Code != status {
		panic(fmt.Errorf("Status: (expected) %d != %d (actual)", status, t.Response.Code))
	}
}
func (t *TestSuite) AssertContentType(contentType string) {
	t.AssertHeader("Content-Type", contentType)
}
func (t *TestSuite) AssertHeader(name, value string) {
	actual := t.Response.HeaderMap.Get(name)
	if actual != value {
		panic(fmt.Errorf("Header %s: (expected) %s != %s (actual)", name, value, actual))
	}
}
func (t *TestSuite) AssertEqual(expected, actual interface{}) {
	if !revel.Equal(expected, actual) {
		panic(fmt.Errorf("(expected) %v != %v (actual)", expected, actual))
	}
}
func (t *TestSuite) AssertNotEqual(expected, actual interface{}) {
	if revel.Equal(expected, actual) {
		panic(fmt.Errorf("(expected) %v == %v (actual)", expected, actual))
	}
}
func (t *TestSuite) Assert(exp bool) {
	t.Assertf(exp, "Assertion failed")
}
func (t *TestSuite) Assertf(exp bool, formatStr string, args ...interface{}) {
	if !exp {
		panic(fmt.Errorf(formatStr, args...))
	}
}
func (t *TestSuite) AssertContains(s string) {
	if !bytes.Contains(t.Response.Body.Bytes(), []byte(s)) {
		panic(fmt.Errorf("Assertion failed. Expected response to contain %s", s))
	}
}