#64 explorer draft view

This commit is contained in:
Leonhard Strohmidel
2022-09-25 18:02:59 +02:00
parent 724c26c926
commit df67bcf639
5 changed files with 80 additions and 3 deletions

View File

@@ -84,6 +84,34 @@ class TestExplorerProfileView(GlobalTemplateTestCaseMixin, ViewTestCase):
msg='Expecting the latest place to be visible on the submitters profile page'
)
def test_draft_in_explorer_places(self):
user = User.objects.get(username='testpeter')
Place.objects.create(
name='Im the latest place in draft 3671',
submitted_when=timezone.now(),
submitted_by=user.explorer,
location='Test %d town' % 5,
latitude=50.5 + 5/10,
longitude=7.0 - 5/10,
description='This is just a test, do not worry %d' % 5,
level=3,
mode='draft'
)
self.client.login(username='testpeter', password='Develop123')
response = self.client.get(
reverse('explorer_profile', kwargs={
'explorer_id': user.explorer.id
})
)
self.assertHttpOK(response)
self.assertFalse(
'Im the latest place in draft 3671' in response.content.decode(),
msg='Expecting a place in draft mode to not show up on the submitters profile page'
)
def test_explorer_image(self):
user = User.objects.get(username='testpeter')
place = Place.objects.create(