from todo.test_base import BaseTestCase

import unittest
from flask import json, url_for

class IndexTestCase(BaseTestCase):

    def test_index(self):
        response = self.app.get(url_for("index"))
        self.assertEqual(response.status_code, 200)

    def test_cors_headers(self):
        response = self.app.get(url_for("index"), headers={"Origin": "www.example.com"})
        self.assertEqual(response.headers["Access-Control-Allow-Origin"], "www.example.com")