travis-ci
238 of 261 branches covered (91.19%)
Branch coverage included in aggregate %.
16 of 16 new or added lines in 3 files covered. (100.0%)
627 of 663 relevant lines covered (94.57%)
11.29 hits per line
1 |
from itertools import tee |
12✔ |
|
try:
|
12✔ |
|
from django.utils.six.moves import zip |
12✔ |
|
except ImportError: |
× |
|
pass
|
× |
6 |
|
|
7 |
|
|
8 |
def pairwise(iterable): |
12✔ |
9 |
a, b = tee(iterable) |
12✔ |
10 |
next(b, None) |
12✔ |
11 |
return zip(a, b) |
12✔ |
12 |
|
|
13 |
|
|
14 |
def is_computedfield(model, field): |
12✔ |
15 |
return hasattr(model, '_computed_fields') and field in model._computed_fields |
× |
16 |
|
|
17 |
|
|
18 |
def modelname(model): |
12✔ |
19 |
return '%s.%s' % (model._meta.app_label, model._meta.verbose_name) |
12✔ |
20 |
|
|
21 |
|
|
22 |
def is_sublist(needle, haystack): |
12✔ |
23 |
if not needle: |
|
24 |
return True |
× |
25 |
if not haystack: |
|
26 |
return False |
× |
27 |
max_k = len(needle) - 1 |
12✔ |
28 |
k = 0
|
12✔ |
29 |
for elem in haystack: |
|
30 |
if elem != needle[k]:
|
|
31 |
k = 0
|
12✔ |
32 |
continue
|
12✔ |
33 |
if k == max_k:
|
|
34 |
return True |
12✔ |
35 |
k += 1
|
12✔ |
36 |
return False |
12✔ |