Skip to content

Commit

Permalink
Unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
victorette committed May 27, 2014
1 parent 1f20326 commit c292654
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/dbDesigner/test/ProtoDiagramTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.test.client import RequestFactory
from django.http import HttpRequest
from dbDesigner.protoDiagram import getEntitiesJSONDiagram, synchDiagramFromDB, getElementsDiagramFromSelectedTables, synchDBFromDiagram, getDefaultDiagram
from dbDesigner.protoDiagramEntity import listDiagrams, openDiagram, createDiagram, saveDiagram
from dbDesigner.protoDiagramEntity import listDiagrams, openDiagram, createDiagram, saveDiagram, deleteDiagram
from prototype.testprototype.testmodels.TestUtilities import createTestDiagram, createTestEntity
from requests import Request
from django.contrib.auth import authenticate
Expand Down Expand Up @@ -43,7 +43,7 @@ def CreatePreparedAuthPostRequest():
factory = RequestFactory()
auth = authenticate(username='adube', password='123')

request = factory.post("/protoLib/createDiagram", {u'diagrams': [u'{"projectID":1,"id":"","code":"test","smUUID":""}']})
request = factory.post("/protoLib/createDiagram", {u'diagrams': [u'{"projectID":1,"id":"1","code":"test","smUUID":""}']})
request.user = auth

return request
Expand Down Expand Up @@ -112,4 +112,9 @@ def test_saveDiagram(self):
def test_createDiagram(self):
request = CreatePreparedAuthPostRequest()
response = json.loads(createDiagram(request).content)
self.assertTrue(response['success'])

def test_deleteDiagram(self):
request = CreatePreparedAuthPostRequest()
response = json.loads(deleteDiagram(request).content)
self.assertTrue(response['success'])

0 comments on commit c292654

Please sign in to comment.