This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BidRouter(routers.SimpleRouter): | |
""" Custom Router to allow /bids/?url= for detail view """ | |
def __init__(self, trailing_slash=True): | |
self.routes.append(routers.Route( | |
url=r'^{prefix}/?url={lookup}{trailing_slash}$', | |
mapping={ | |
'get': 'retrieve', | |
'put': 'update', | |
'patch': 'partial_update', | |
'delete': 'destroy' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bid_router = BidRouter() | |
bid_router.register(r'bids', views.BidViewSet) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def has_voted(self, request): | |
"""Did the user already vote for this document?""" | |
if request.user.is_authenticated(): | |
qs = HelpfulVote.objects.filter(document=self, | |
creator=request.user) | |
elif request.anonymous.has_id: | |
anon_id = request.anonymous.anonymous_id | |
qs = HelpfulVote.objects.filter(document=self, | |
anonymous_id=anon_id) | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
====================================================================== [54/1356] | |
FAIL: test_database_filter (apps.search.tests.test_filters.FilterTests) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/vagrant/src/apps/search/tests/test_filters.py", line 86, in test_database_filter | |
eq_(response.data['documents'][0]['slug'], 'le-title') | |
AssertionError: u'article-title' != 'le-title' | |
====================================================================== | |
FAIL: test_document_serializer (apps.search.tests.test_serializers.SerializerTests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def forwards(self, orm): | |
""" | |
Switch the 'disallow_add_attachment' permission to belong to | |
the attachments app instead of the wiki app. | |
""" | |
from django.core.exceptions import ObjectDoesNotExist | |
wiki_ctype = None | |
disallow_permission = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mock.patch('devmo.decorators.never_cache') | |
def test_views_never_cached(self, mock_never_cache): | |
mock_never_cache = mock.Mock() | |
import ipdb; ipdb.set_trace() | |
self.client.login(username='admin', password='testpass') | |
locale = settings.WIKI_DEFAULT_LANGUAGE | |
new_url = reverse('wiki.new_document', locale=locale) | |
edit_url = reverse('wiki.edit_document', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AllauthGitHubTestCase(UserTestCase): | |
""" | |
Test sign-up/in flow with GitHub. | |
""" | |
localizing_client = False | |
def test_github_auth_success(self): | |
url_params = { | |
'access_token': 123456789, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file { '/usr/local/bin/stylus': | |
ensure => 'present', | |
require => Exec['stylus-install'], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get stylus | |
class stylus { | |
exec { 'stylus-install': | |
command => '/usr/bin/npm install -g stylus@0.43.1', | |
creates => '/usr/bin/stylus', | |
require => [ | |
Package['nodejs'], | |
] | |
} | |
file { '/usr/local/bin/stylus': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(kuma)lcrouch-14912:ui lcrouch$ ./node_modules/.bin/intern-runner config=intern-local | |
Listening on 0.0.0.0:9000 | |
Starting tunnel... | |
UnknownError: [POST http://127.0.0.1:4444/wd/hub/session / {"desiredCapabilities":{"browserName":"chrome","name":"intern-local","idle-timeout":60,"selenium-version":"2.43.1"}}] The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html | |
at Server._post <node_modules/intern/node_modules/leadfoot/Server.js:68:9> | |
at Server.createSession <node_modules/intern/node_modules/leadfoot/Server.js:290:15> | |
at Suite.setup <node_modules/intern/runner.js:222:22> | |
at callOnSuite <node_modules/intern/lib/Suite.js:157:42> | |
at call <node_modules/intern/lib/Suite.js:208:13> | |
at Suite.run <node_modules/intern/lib/Suite.js:306:4> |