Skip to content

Commit 0abcd65

Browse files
committed
Make new benchmark parent field optional in the admin
Fixes tobami#127
1 parent 2265bae commit 0abcd65

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

codespeed/models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,15 @@ class Benchmark(models.Model):
133133

134134
name = models.CharField(unique=True, max_length=30)
135135
parent = models.ForeignKey('self', verbose_name="parent",
136-
help_text="allows to group benchmarks in hierarchies", null=True, default=None)
136+
help_text="allows to group benchmarks in hierarchies",
137+
null=True, blank=True, default=None)
137138
benchmark_type = models.CharField(max_length=1, choices=B_TYPES, default='C')
138139
description = models.CharField(max_length=300, blank=True)
139140
units_title = models.CharField(max_length=30, default='Time')
140141
units = models.CharField(max_length=20, default='seconds')
141142
lessisbetter = models.BooleanField("Less is better", default=True)
142-
default_on_comparison = models.BooleanField("Default on comparison page", default=True)
143+
default_on_comparison = models.BooleanField(
144+
"Default on comparison page", default=True)
143145

144146
def __unicode__(self):
145147
return self.name

codespeed/tests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
32
import os
43
import re
54
import unittest
@@ -13,6 +12,7 @@
1312

1413
DEFAULT_TESTFILE_PATTERN = re.compile(r'^[a-zA-Z0-9].*\.py')
1514

15+
1616
def get_suite(*names, **kwargs):
1717
'''Creates (or updates) a ``TestSuite`` consisting of the tests under one or
1818
more modules.
@@ -44,7 +44,7 @@ def get_suite(*names, **kwargs):
4444
suite = kwargs.get('suite') or unittest.TestSuite()
4545
# determine is_test_module
4646
is_test_module = kwargs.get('is_test_module', DEFAULT_TESTFILE_PATTERN)
47-
if isinstance(is_test_module, basestring): # look for exact match
47+
if isinstance(is_test_module, basestring): # look for exact match
4848
is_test_module = re.compile(is_test_module + '$').match
4949
elif hasattr(is_test_module, 'match'):
5050
is_test_module = is_test_module.match

0 commit comments

Comments
 (0)