Пример #1
0
 def test_page_renders_locales(self):
     """Load the page and verify it contains all the locales for l10n."""
     response = get(self.client, 'wiki.select_locale', args=[self.d.slug])
     eq_(200, response.status_code)
     doc = pq(response.content)
     eq_(
         len(settings.LANGUAGES) - 1,  # All except for 1 (en-US)
         len(doc('#select-locale ul.locales li')))
Пример #2
0
 def test_page_renders_locales(self):
     """Load the page and verify it contains all the locales for l10n."""
     response = get(self.client, 'wiki.select_locale',
                    args=[self.d.slug])
     eq_(200, response.status_code)
     doc = pq(response.content)
     eq_(len(settings.LANGUAGES) - 1,  # All except for 1 (en-US)
         len(doc('#select-locale ul.locales li')))
Пример #3
0
 def test_can_save_document_with_translations(self):
     """Make sure we can save a document with translations."""
     # Create a translation
     _create_document(title='Document Prueba', parent=self.d, locale='es')
     # Make sure is_localizable hidden field is rendered
     response = get(self.client, 'wiki.edit', args=[self.d.slug])
     eq_(200, response.status_code)
     doc = pq(response.content)
     data = new_document_data()
     new_title = 'A brand new title'
     data.update(title=new_title)
     data.update(form='doc')
     data.update(is_localizable='True')
     response = post(self.client, 'wiki.edit', data, args=[self.d.slug])
     eq_(200, response.status_code)
     doc = Document.objects.get(pk=self.d.pk)
     eq_(new_title, doc.title)
Пример #4
0
 def test_can_save_document_with_translations(self):
     """Make sure we can save a document with translations."""
     # Create a translation
     _create_document(title='Document Prueba', parent=self.d,
                      locale='es')
     # Make sure is_localizable hidden field is rendered
     response = get(self.client, 'wiki.edit',
                    args=[self.d.slug])
     eq_(200, response.status_code)
     doc = pq(response.content)
     data = new_document_data()
     new_title = 'A brand new title'
     data.update(title=new_title)
     data.update(form='doc')
     data.update(is_localizable='True')
     response = post(self.client, 'wiki.edit', data,
                     args=[self.d.slug])
     eq_(200, response.status_code)
     doc = Document.objects.get(pk=self.d.pk)
     eq_(new_title, doc.title)
Пример #5
0
 def test_preview_GET_405(self):
     """Preview with HTTP GET results in 405."""
     response = get(self.client, 'wiki.preview')
     eq_(405, response.status_code)
Пример #6
0
 def test_preview_GET_405(self):
     """Preview with HTTP GET results in 405."""
     response = get(self.client, 'wiki.preview')
     eq_(405, response.status_code)