Diff of /ForgeBlog/forgeblog/tests/unit/__init__.py [000000] .. [b7ee6e]  Maximize  Restore

Switch to side-by-side view

--- a
+++ b/ForgeBlog/forgeblog/tests/unit/__init__.py
@@ -0,0 +1,27 @@
+from pylons import c
+from ming.orm.ormsession import ThreadLocalORMSession
+
+from allura.websetup import bootstrap
+from allura.lib import helpers as h
+from allura.lib import plugin
+from allura import model as M
+from alluratest.controller import setup_basic_test
+
+
+def setUp():
+    setup_basic_test()
+
+class BlogTestWithModel(object):
+    def setUp(self):
+        bootstrap.wipe_database()
+        project_reg = plugin.ProjectRegistrationProvider.get()
+        c.user = bootstrap.create_user('Test User')
+        neighborhood = M.Neighborhood(name='Projects', url_prefix='/p/')
+        project_reg.register_neighborhood_project(neighborhood, [c.user])
+        c.project = neighborhood.register_project('test', c.user)
+        c.project.install_app('Blog', 'blog')
+        ThreadLocalORMSession.flush_all()
+        h.set_context('test', 'blog')
+
+    def tearDown(self):
+        ThreadLocalORMSession.close_all()

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks