Remove accidently copied files in watching.
parent
c8759215e3
commit
d023f33e2c
|
@ -1,67 +0,0 @@
|
|||
from django.conf import settings
|
||||
from django.test import TestCase
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
import json
|
||||
|
||||
from projects.models import Conf
|
||||
|
||||
data = """
|
||||
{
|
||||
"before": "5aef35982fb2d34e9d9d4502f6ede1072793222d",
|
||||
"repository": {
|
||||
"url": "http://github.com/beetletweezers/tweezers",
|
||||
"name": "github",
|
||||
"description": "You're lookin' at it.",
|
||||
"watchers": 5,
|
||||
"forks": 2,
|
||||
"private": 1,
|
||||
"owner": {
|
||||
"email": "chris@ozmm.org",
|
||||
"name": "defunkt"
|
||||
}
|
||||
},
|
||||
"commits": [
|
||||
{
|
||||
"id": "41a212ee83ca127e3c8cf465891ab7216a705f59",
|
||||
"url": "http://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59",
|
||||
"author": {
|
||||
"email": "chris@ozmm.org",
|
||||
"name": "Chris Wanstrath"
|
||||
},
|
||||
"message": "okay i give in",
|
||||
"timestamp": "2008-02-15T14:57:17-08:00",
|
||||
"added": ["filepath.rb"]
|
||||
},
|
||||
{
|
||||
"id": "de8251ff97ee194a289832576287d6f8ad74e3d0",
|
||||
"url": "http://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0",
|
||||
"author": {
|
||||
"email": "chris@ozmm.org",
|
||||
"name": "Chris Wanstrath"
|
||||
},
|
||||
"message": "update pricing a tad",
|
||||
"timestamp": "2008-02-15T14:36:34-08:00"
|
||||
}
|
||||
],
|
||||
"after": "de8251ff97ee194a289832576287d6f8ad74e3d0",
|
||||
"ref": "refs/heads/master"
|
||||
}
|
||||
"""
|
||||
|
||||
class Basic(TestCase):
|
||||
fixtures=['eric', 'test_data']
|
||||
|
||||
def setUp(self):
|
||||
settings.CELERY_ALWAYS_EAGER = True
|
||||
|
||||
def tearDown(self):
|
||||
settings.CELERY_ALWAYS_EAGER = False
|
||||
|
||||
def test_github(self):
|
||||
resp = self.client.post('/github', {'payload': data})
|
||||
self.assertEqual(Conf.objects.count(), 1)
|
||||
conf = Conf.objects.all()[0]
|
||||
self.assertEqual(conf.theme, 'default')
|
||||
self.assertTrue(conf.path is not None)
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
from django.conf.urls.defaults import *
|
||||
|
||||
urlpatterns = patterns('watching.views',
|
||||
url(r'^$',
|
||||
'project_index',
|
||||
name='projects_list'
|
||||
),
|
||||
url(r'^tags/$',
|
||||
'tag_index',
|
||||
name='project_tag_list',
|
||||
),
|
||||
url(r'^search/',
|
||||
'search',
|
||||
name='search',
|
||||
),
|
||||
url(r'^tags/(?P<tag>\w+)/$',
|
||||
'project_index',
|
||||
name='project_tag_detail',
|
||||
),
|
||||
url(r'^projects/(?P<username>\w+)/(?P<project_slug>[-\w]+)/$',
|
||||
'project_detail',
|
||||
name='projects_detail'
|
||||
),
|
||||
url(r'^(?P<username>\w+)/$',
|
||||
'project_index',
|
||||
name='projects_user_list'
|
||||
),
|
||||
)
|
|
@ -1,33 +0,0 @@
|
|||
from django.conf import settings
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render_to_response
|
||||
from django.template import RequestContext
|
||||
from django.views.decorators.csrf import csrf_view_exempt
|
||||
from django.views.static import serve
|
||||
|
||||
import json
|
||||
|
||||
from projects.models import Project
|
||||
from projects.tasks import update_docs
|
||||
from projects.utils import find_file
|
||||
|
||||
|
||||
@csrf_view_exempt
|
||||
def github_build(request):
|
||||
obj = json.loads(request.POST['payload'])
|
||||
name = obj['repository']['name']
|
||||
url = obj['repository']['url']
|
||||
project = Project.objects.get(repo=url)
|
||||
update_docs.delay(pk=project.pk)
|
||||
return HttpResponse('Build Started')
|
||||
|
||||
def serve_docs(request, username, project_slug, filename):
|
||||
proj = Project.objects.get(slug=project_slug, user__username=username)
|
||||
if not filename:
|
||||
filename = "index.html"
|
||||
filename = filename.rstrip('/')
|
||||
return serve(request, filename, proj.full_html_path)
|
||||
|
||||
def render_header(request):
|
||||
return render_to_response('core/header.html', {},
|
||||
context_instance=RequestContext(request))
|
Loading…
Reference in New Issue