#!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


"""Tests for age check related views.
"""

__authors__ = [
  '"Lennard de Rijk" <ljvderijk@gmail.com>',
  ]


from tests.test_utils import GCIDjangoTestCase


class AgeCheckTest(GCIDjangoTestCase):
  """Tests age check page.
  """

  def setUp(self):
    self.init()

  def assertProgramTemplatesUsed(self, response):
    """Asserts that all the templates were used.
    """
    self.assertGCITemplatesUsed(response)
    self.assertTemplateUsed(response, 'v2/modules/gci/age_check/base.html')

  def testAgeCheckViewable(self):
    url = '/gci/age_check/' + self.gci.key().name()
    response = self.client.get(url)
    self.assertTemplateUsed(response)

  # TODO(ljvderijk): Add more tests that also check the cookies that are set

Add basic test case for the age check view.
Add basic test case for the age check view.

Only check if the page can actually be rendered, need more info on how to deal with cookies and user authentication inside tests to expand this.
