diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui')
-rw-r--r-- | bitbake/lib/toaster/toastergui/urls.py | 3 | ||||
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py index f74090b9ba..46e5761443 100644 --- a/bitbake/lib/toaster/toastergui/urls.py +++ b/bitbake/lib/toaster/toastergui/urls.py | |||
@@ -145,6 +145,9 @@ urlpatterns = patterns('toastergui.views', | |||
145 | url(r'^xhr_importlayer/$', 'xhr_importlayer', name='xhr_importlayer'), | 145 | url(r'^xhr_importlayer/$', 'xhr_importlayer', name='xhr_importlayer'), |
146 | url(r'^xhr_updatelayer/$', 'xhr_updatelayer', name='xhr_updatelayer'), | 146 | url(r'^xhr_updatelayer/$', 'xhr_updatelayer', name='xhr_updatelayer'), |
147 | 147 | ||
148 | # JS Unit tests | ||
149 | url(r'^js-unit-tests/$', 'jsunittests', name='js-unit-tests'), | ||
150 | |||
148 | # default redirection | 151 | # default redirection |
149 | url(r'^$', RedirectView.as_view( url= 'landing')), | 152 | url(r'^$', RedirectView.as_view( url= 'landing')), |
150 | ) | 153 | ) |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index c8ff693ae6..c583d9613a 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -31,6 +31,7 @@ from django.shortcuts import render, redirect | |||
31 | from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable | 31 | from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable |
32 | from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency | 32 | from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency |
33 | from orm.models import Target_Installed_Package, Target_File, Target_Image_File, BuildArtifact | 33 | from orm.models import Target_Installed_Package, Target_File, Target_Image_File, BuildArtifact |
34 | from orm.models import BitbakeVersion | ||
34 | from bldcontrol import bbcontroller | 35 | from bldcontrol import bbcontroller |
35 | from django.views.decorators.cache import cache_control | 36 | from django.views.decorators.cache import cache_control |
36 | from django.core.urlresolvers import reverse, resolve | 37 | from django.core.urlresolvers import reverse, resolve |
@@ -2260,6 +2261,21 @@ if True: | |||
2260 | 2261 | ||
2261 | return context | 2262 | return context |
2262 | 2263 | ||
2264 | def jsunittests(request): | ||
2265 | """ Provides a page for the js unit tests """ | ||
2266 | bbv = BitbakeVersion.objects.filter(branch="master").first() | ||
2267 | release = Release.objects.filter(bitbake_version=bbv).first() | ||
2268 | |||
2269 | name = "_js_unit_test_prj_" | ||
2270 | |||
2271 | # If there is an existing project by this name delete it. We don't want | ||
2272 | # Lots of duplicates cluttering up the projects. | ||
2273 | Project.objects.filter(name=name).delete() | ||
2274 | |||
2275 | new_project = Project.objects.create_project(name=name, release=release) | ||
2276 | |||
2277 | context = { 'project' : new_project } | ||
2278 | return render(request, "js-unit-tests.html", context) | ||
2263 | 2279 | ||
2264 | from django.views.decorators.csrf import csrf_exempt | 2280 | from django.views.decorators.csrf import csrf_exempt |
2265 | @csrf_exempt | 2281 | @csrf_exempt |