|
@@ -16,6 +16,8 @@
|
|
|
# See the License for the specific language governing permissions and
|
|
# See the License for the specific language governing permissions and
|
|
|
# limitations under the License.
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
+import json
|
|
|
|
|
+
|
|
|
from nose.tools import assert_equal
|
|
from nose.tools import assert_equal
|
|
|
from django.contrib.auth.models import User
|
|
from django.contrib.auth.models import User
|
|
|
|
|
|
|
@@ -34,6 +36,12 @@ class TestDocument2(object):
|
|
|
self.user = User.objects.get(username="doc2")
|
|
self.user = User.objects.get(username="doc2")
|
|
|
grant_access("doc2", "doc2", "beeswax")
|
|
grant_access("doc2", "doc2", "beeswax")
|
|
|
|
|
|
|
|
|
|
+ # Setup Home dir this way currently
|
|
|
|
|
+ response = self.client.get('/desktop/api2/docs/')
|
|
|
|
|
+ data = json.loads(response.content)
|
|
|
|
|
+
|
|
|
|
|
+ assert_equal('/', data['path'], data)
|
|
|
|
|
+
|
|
|
|
|
|
|
|
def test_document_create(self):
|
|
def test_document_create(self):
|
|
|
sql = 'SELECT * FROM sample_07'
|
|
sql = 'SELECT * FROM sample_07'
|
|
@@ -68,3 +76,10 @@ class TestDocument2(object):
|
|
|
assert_equal([], new_query_data['snippets'][0]['properties']['functions'])
|
|
assert_equal([], new_query_data['snippets'][0]['properties']['functions'])
|
|
|
finally:
|
|
finally:
|
|
|
old_query.delete()
|
|
old_query.delete()
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ def test_directory_create(self):
|
|
|
|
|
+ response = self.client.post('/desktop/api2/doc/mkdir', {'parent_path': json.dumps('/'), 'name': json.dumps('test_mkdir')})
|
|
|
|
|
+ data = json.loads(response.content)
|
|
|
|
|
+
|
|
|
|
|
+ assert_equal(0, data['status'], data)
|