from takeyourmeds.utils.test import TestCase

from ..enums import TypeEnum, SourceEnum

from .enums import StateEnum

class TwimlCallbackTest(TestCase):
    def setUp(self):
        super(TwimlCallbackTest, self).setUp()

        self.call = self.user.reminders.create(
            type=TypeEnum.call,
        ).instances.create(
            source=SourceEnum.manual,
        ).calls.create()

    def test_url(self):
        url = self.call.get_twiml_callback_url()

        self.assert_(url.startswith('http'))

@@ -1,12 +1,46 @@
+from django.conf import settings%0A%0A
 from takeyou
@@ -262,20 +262,24 @@
    self.
-call
+reminder
  = self.
@@ -341,17 +341,88 @@
         
-)
+    audio_url='/dummy.mp3',%0A        )%0A%0A        self.call = self.reminder
 .instanc
@@ -615,8 +615,360 @@
 http'))%0A
+%0A    def test_content(self):%0A        response = self.assertGET(%0A            200,%0A            'reminders:calls:twiml-callback',%0A            self.call.ident,%0A        )%0A%0A        self.assert_(response.content.startswith('%3C?xml'))%0A        self.assert_(settings.SITE_URL in response.content)%0A        self.assert_(self.reminder.audio_url in response.content)%0A

Check we get some sane XML back