~milo/linaro-ci-dashboard/refactor-job-schedule

« back to all changes in this revision

Viewing changes to dashboard/frontend/android_build/tests/test_android_build_views.py

  • Committer: Milo Casagrande
  • Date: 2012-08-17 14:44:43 UTC
  • mfrom: (17.4.14 android_build_view)
  • Revision ID: milo@ubuntu.com-20120817144443-v5j67188475apaib
Merged android_build create view.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2012 Linaro
 
2
#
 
3
# This file is part of linaro-ci-dashboard.
 
4
#
 
5
# linaro-ci-dashboard is free software: you can redistribute it and/or modify
 
6
# it under the terms of the GNU Affero General Public License as published by
 
7
# the Free Software Foundation, either version 3 of the License, or
 
8
# (at your option) any later version.
 
9
#
 
10
# linaro-ci-dashboard is distributed in the hope that it will be useful,
 
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
# GNU Affero General Public License for more details.
 
14
#
 
15
# You should have received a copy of the GNU Affero General Public License
 
16
# along with linaro-ci-dashboard.  If not, see <http://www.gnu.org/licenses/>.
 
17
from django.test import TestCase
 
18
from mock import Mock
 
19
 
 
20
from frontend.android_build.views.android_loop_create_view \
 
21
    import AndroidLoopCreateView
 
22
 
 
23
 
 
24
class AndroidBuildViewsTest(TestCase):
 
25
 
 
26
    def setUp(self):
 
27
        self.mock_loop = Mock()
 
28
 
 
29
    def test_create_view_get_context_data(self):
 
30
        android_loop_create_view = AndroidLoopCreateView()
 
31
        android_loop_create_view.request = "some request data"
 
32
        android_loop_create_view.object = self.mock_loop
 
33
        context = AndroidLoopCreateView.get_context_data(
 
34
            android_loop_create_view)
 
35
        self.assertEqual(context['request'], "some request data")