Permalink
Browse files

Make new benchmark parent field optional in the admin

Fixes #127
  • Loading branch information...
1 parent 2265bae commit 0abcd65fccb03bce2512c3551b93660870d69b0f @tobami committed Oct 6, 2012
Showing with 6 additions and 4 deletions.
  1. +4 −2 codespeed/models.py
  2. +2 −2 codespeed/tests/__init__.py
View
@@ -133,13 +133,15 @@ class Benchmark(models.Model):
name = models.CharField(unique=True, max_length=30)
parent = models.ForeignKey('self', verbose_name="parent",
- help_text="allows to group benchmarks in hierarchies", null=True, default=None)
+ help_text="allows to group benchmarks in hierarchies",
+ null=True, blank=True, default=None)
benchmark_type = models.CharField(max_length=1, choices=B_TYPES, default='C')
description = models.CharField(max_length=300, blank=True)
units_title = models.CharField(max_length=30, default='Time')
units = models.CharField(max_length=20, default='seconds')
lessisbetter = models.BooleanField("Less is better", default=True)
- default_on_comparison = models.BooleanField("Default on comparison page", default=True)
+ default_on_comparison = models.BooleanField(
+ "Default on comparison page", default=True)
def __unicode__(self):
return self.name
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
-
import os
import re
import unittest
@@ -13,6 +12,7 @@
DEFAULT_TESTFILE_PATTERN = re.compile(r'^[a-zA-Z0-9].*\.py')
+
def get_suite(*names, **kwargs):
'''Creates (or updates) a ``TestSuite`` consisting of the tests under one or
more modules.
@@ -44,7 +44,7 @@ def get_suite(*names, **kwargs):
suite = kwargs.get('suite') or unittest.TestSuite()
# determine is_test_module
is_test_module = kwargs.get('is_test_module', DEFAULT_TESTFILE_PATTERN)
- if isinstance(is_test_module, basestring): # look for exact match
+ if isinstance(is_test_module, basestring): # look for exact match
is_test_module = re.compile(is_test_module + '$').match
elif hasattr(is_test_module, 'match'):
is_test_module = is_test_module.match

0 comments on commit 0abcd65

Please sign in to comment.