@@ -0,0 +1,2104 @@
+from django.test import TestCase%0Afrom django.core.urlresolvers import reverse%0Afrom django.contrib.auth.models import User%0A%0Afrom excerptexport.models import Excerpt, ExtractionOrder, BoundingGeometry%0Afrom excerptexport.models.extraction_order import ExtractionOrderState%0A%0A%0Aclass StatusTestCase(TestCase):%0A    extraction_order = None;%0A%0A    def setUp(self):%0A        user = User.objects.create_user('user', 'user@example.com', 'pw')%0A        self.client.login(username='user', password='pw')%0A%0A        bounding_geometry = BoundingGeometry.create_from_bounding_box_coordinates(48, 9, 46, 6)%0A        bounding_geometry.save()%0A%0A        excerpt = Excerpt.objects.create(%0A            name=%22Switzerland%22,%0A            is_active=True,%0A            is_public=True,%0A            bounding_geometry = bounding_geometry,%0A            owner=user%0A        )%0A%0A        self.extraction_order = ExtractionOrder.objects.create(%0A            excerpt=excerpt,%0A            orderer=user%0A        )%0A%0A%0A    def test_extraction_order_status_initialized(self):%0A        response = self.client.get(reverse('excerptexport:status', kwargs=%7B 'extraction_order_id': self.extraction_order.id %7D))%0A%0A        self.assertEqual(response.status_code, 200)%0A        self.assertEqual(response.context%5B'extraction_order'%5D, self.extraction_order)%0A        self.assertContains(response, 'INITIALIZED')%0A%0A%0A    def test_extraction_order_status_finished(self):%0A        self.extraction_order.state = ExtractionOrderState.FINISHED%0A        self.extraction_order.save()%0A%0A        response = self.client.get(reverse('excerptexport:status', kwargs=%7B 'extraction_order_id': self.extraction_order.id %7D))%0A%0A        self.assertEqual(response.status_code, 200)%0A        self.assertEqual(response.context%5B'extraction_order'%5D, self.extraction_order)%0A        self.assertContains(response, 'FINISHED')%0A%0A%0A    def test_extraction_order_id_not_existing(self):%0A%0A        response = self.client.get(reverse('excerptexport:status', kwargs=%7B 'extraction_order_id': 9999999999 %7D))%0A%0A        self.assertEqual(response.status_code, 404)%0A        self.assertFalse('extraction_order' in response.context)

Test status view