Commits

Ronny Pfannschmidt  committed 584d4be

finish first functional test

  • Participants
  • Parent commits 28c3501
  • Branches flask-port

Comments (0)

Files changed (1)

File testing/test_basic.py

+import pytest
 
-
-def test_yay_i_can_paste(app, client):
-    app.debug=True
-    page = client.get('/')
-    res = client.post('/', data='code=print%201&langauge=python')
-    print res
-    print res.data
-    assert 0
+def test_yay_i_can_paste(client):
+    #age = client.get('/')
+    res = client.post('/', data={
+        'code':'print 1',
+        'language': 'python',
+    })
+    assert res.status_code == 302
+    print res.headers
+    assert res.headers['location'] == 'http://localhost/show/1'
+    client.get('/show/1').data
+    raw = client.get('/raw/1')
+    print raw.headers
+    assert raw.data == 'print 1'