~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/views/tests/test_helpers.py

[r=adeuring,abentley][bug=1199790][author=adeuring] Return dummy data for Charm.last_change and Charm.first_change, if a branch does not have any commits.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
from charmworld.models import Charm
5
5
from charmworld.views.helpers import (
 
6
    format_change,
6
7
    interfaces,
7
8
    result_sorter,
8
9
)
129
130
        charm_b = factory.get_charm_json(series='raring')
130
131
        with self.assertNoException():
131
132
            result_sorter(charm_a, charm_b)
 
133
 
 
134
    def test_format_change(self):
 
135
        charm = Charm(factory.get_charm_json())
 
136
        result = format_change(charm.last_change)
 
137
        self.assertEqual('2012/07/23 John Doe maintainer', result)
 
138
 
 
139
    def test_format_change_empty_branch(self):
 
140
        charm = Charm(factory.get_charm_json(empty_branch=True))
 
141
        result = format_change(charm.last_change)
 
142
        self.assertEqual(' ', result)