Skip to content

Instantly share code, notes, and snippets.

View groovecoder's full-sized avatar

luke crouch groovecoder

View GitHub Profile
def get_file_url(self):
uri = reverse('wiki.raw_file', attachment_id=self.id,
filename=self.current_revision.filename())
return uri
def get_file_url(self):
uri = reverse('wiki.raw_file', kwargs={'attachment_id': self.id,
'filename': self.current_revision.filename()})
url = '%s://%s%s' % (scheme, constance.config.ATTACHMENT_HOST, uri)
return url
// #### Evaluate macros
evaluateMacros: function (api_ctx, templates, macros, src, next_cb) {
var $this = this,
errors = [],
hashes = _.keys(macros);
$this.emit('api_ctx', api_ctx);
def test_translate_en_subpage(self):
client = LocalizingClient()
client.login(username='testuser', password='testpass')
en_doc = document(locale='en-US', slug='en', title='MDN', save=True)
en_rev = revision(document=en_doc, save=True)
nl_doc = document(locale='nl', slug='en', title='MDN', save=True)
nl_doc.parent = en_doc
nl_doc.save()
======================================================================
FAIL: test_section_edit_review_tags (wiki.tests.test_views.SectionEditingResourceTests)
review tags are preserved in section editing.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/vagrant/apps/wiki/tests/test_views.py", line 2347, in test_section_edit_review_tags
[t.name for t in changed.review_tags.all()])
File "/vagrant/vendor/packages/nose/nose/tools.py", line 31, in eq_
assert a == b, msg or "%r != %r" % (a, b)
AssertionError: ['foo', 'bar'] != [u'bar', u'foo']
BUILD_ID_CSS = "264bd8d"
BUILD_ID_JS = "264bd8d"
from elasticutils.contrib.django.models import DjangoMappingType, Indexable
from wiki.models import Document
class DocumentType(DjangoMappingType, Indexable):
@classmethod
def get_model(cls):
return Document
@cronjobs.register
def reindex_documents():
reindex_objects(Document)
>>> from django.contrib.auth.models import User
>>> User.objects.all()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 69, in __repr__
data = list(self[:REPR_OUTPUT_SIZE + 1])
File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 84, in __len__
self._result_cache.extend(self._iter)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 273, in iterator
for row in compiler.results_iter():
..E
======================================================================
ERROR: test_write_to_file (vagrant.apps.humans.tests.HumansTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/vagrant/../vagrant/apps/humans/tests.py", line 62, in test_write_to_file
ht.write_to_file(humans, target, "Banner Message")
TypeError: write_to_file() takes exactly 5 arguments (4 given)
----------------------------------------------------------------------