Fixed #683
This commit is contained in:
parent
c81177ea7a
commit
9e5088d49e
@ -43,7 +43,7 @@
|
||||
</small>
|
||||
</h1>
|
||||
<p>
|
||||
{% if item.get_related_slide == item %}
|
||||
{% if not item.related_sid %}
|
||||
{{ item.text|safe|linebreaks }}
|
||||
{% else %}
|
||||
<a href="{% model_url item.get_related_slide %}" class="btn btn-small">{% trans 'View' %} "{{ item.get_related_slide }}" ({% trans item.get_related_type %})</a>
|
||||
|
@ -15,4 +15,8 @@ class ReleatedItem(SlideMixin, models.Model):
|
||||
def get_agenda_title_supplement(self):
|
||||
return 'test item'
|
||||
|
||||
def get_absolute_url(self, *args, **kwargs):
|
||||
return '/absolute-url-here/'
|
||||
|
||||
|
||||
register_slidemodel(ReleatedItem)
|
||||
|
@ -192,6 +192,16 @@ class ViewTest(TestCase):
|
||||
self.refreshItems()
|
||||
self.assertEqual(self.item1.title, 'newitem1')
|
||||
|
||||
def test_view(self):
|
||||
item = Item.objects.create(title='quai5OTeephaequ0xei0')
|
||||
c = self.adminClient
|
||||
response = c.get('/agenda/%s/' % item.id)
|
||||
self.assertContains(response, 'quai5OTeephaequ0xei0')
|
||||
self.assertTemplateUsed(response, 'agenda/view.html')
|
||||
# Test it twice for former error in the template
|
||||
response = c.get('/agenda/%s/' % item.id)
|
||||
self.assertContains(response, 'quai5OTeephaequ0xei0')
|
||||
|
||||
|
||||
class ConfigTest(TestCase):
|
||||
def setUp(self):
|
||||
|
Loading…
Reference in New Issue
Block a user