def test_generates_tree(self): tree = ProtocolBuilder.generate_etree(factories.UserFactory(), self.procedure.id) assert_equals(len(tree), 4) for child in tree: assert_equals(len(child), 1)
def test_procedure_does_not_exist(self): ProtocolBuilder.generate(factories.UserFactory(), -1)
def test_invalid_owner(self): bad_user = factories.UserFactory(username="******") ProtocolBuilder.generate(bad_user, self.procedure.id)
def test_generates_string_output(self): protocol = ProtocolBuilder.generate(factories.UserFactory(), self.procedure.id) assert_not_equals(protocol, None)