~doanac/ubuntu-ci-services-itself/upgrade-support

« back to all changes in this revision

Viewing changes to ticket_system/ticket_system/local_tests.py

  • Committer: Chris Johnston
  • Date: 2013-12-09 17:29:57 UTC
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: chrisjohnston@ubuntu.com-20131209172957-y8vjn34zq17ugm8h
Add initial setup for the ticket system

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Houston
 
2
# Ubuntu Continuous Integration Engine
 
3
# Copyright 2013 Canonical Ltd.
 
4
 
 
5
# This program is free software: you can redistribute it and/or modify it
 
6
# under the terms of the GNU Affero General Public License version 3, as
 
7
# published by the Free Software Foundation.
 
8
 
 
9
# This program is distributed in the hope that it will be useful, but
 
10
# WITHOUT ANY WARRANTY; without even the implied warranties of
 
11
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
12
# PURPOSE.  See the GNU Affero General Public License for more details.
 
13
 
 
14
# You should have received a copy of the GNU Affero General Public License
 
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 
 
17
from django.test.simple import DjangoTestSuiteRunner
 
18
from django.conf import settings
 
19
 
 
20
 
 
21
class LocalAppsTestSuiteRunner(DjangoTestSuiteRunner):
 
22
    """ Override the default 'test' command to only run local tests. """
 
23
 
 
24
    def run_tests(self, test_labels, *args, **kwargs):
 
25
        if not test_labels:
 
26
            test_labels = settings.LOCAL_APPS
 
27
 
 
28
        return super(LocalAppsTestSuiteRunner, self).run_tests(
 
29
            test_labels, *args, **kwargs)