This file contains hidden or 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 get_file_url(self): | |
uri = reverse('wiki.raw_file', attachment_id=self.id, | |
filename=self.current_revision.filename()) | |
return uri |
This file contains hidden or 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 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 |
This file contains hidden or 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
// #### Evaluate macros | |
evaluateMacros: function (api_ctx, templates, macros, src, next_cb) { | |
var $this = this, | |
errors = [], | |
hashes = _.keys(macros); | |
$this.emit('api_ctx', api_ctx); |
This file contains hidden or 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 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() |
This file contains hidden or 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
====================================================================== | |
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'] |
This file contains hidden or 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
BUILD_ID_CSS = "264bd8d" | |
BUILD_ID_JS = "264bd8d" |
This file contains hidden or 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
from elasticutils.contrib.django.models import DjangoMappingType, Indexable | |
from wiki.models import Document | |
class DocumentType(DjangoMappingType, Indexable): | |
@classmethod | |
def get_model(cls): | |
return Document |
This file contains hidden or 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
@cronjobs.register | |
def reindex_documents(): | |
reindex_objects(Document) |
This file contains hidden or 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
>>> 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(): |
This file contains hidden or 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
..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) | |
---------------------------------------------------------------------- |