Esempio n. 1
0
def test_update_project():
    newname = "newtest"
    newdesc = "this is a new description"
    n = models.new_project(newname, newdesc, p.id)
    assert n.description == newdesc and n.name == newname and n.id is not None
Esempio n. 2
0
import class_models as models
import nose

models.test_session()

p = models.new_project("testproj", "testdesc")  # test project
cid = models.new_class("testc", "testdesc", p.id)  # test class
c = models.db.query(models.Class).filter(models.Class.id == cid).first()


def test_create_project():
    name = "test"
    desc = "this is a test"
    p = models.new_project(name, desc)
    assert p.description == desc and p.name == name and p.id is not None


def test_update_project():
    newname = "newtest"
    newdesc = "this is a new description"
    n = models.new_project(newname, newdesc, p.id)
    assert n.description == newdesc and n.name == newname and n.id is not None


def test_create_class():
    name = "testclass"
    desc = "this is a test class"
    n = models.new_class(name, desc, p.id)
    assert n is not None

Esempio n. 3
0
def test_create_project():
    name = "test"
    desc = "this is a test"
    p = models.new_project(name, desc)
    assert p.description == desc and p.name == name and p.id is not None
Esempio n. 4
0
def new():
    proj = models.new_project(request.form["name"], request.form["description"])
    return redirect("/project?id=%s" % proj.id)