~ubuntu-branches/debian/sid/python-django/sid

« back to all changes in this revision

Viewing changes to tests/version/tests.py

  • Committer: Package Import Robot
  • Author(s): Luke Faraone
  • Date: 2013-11-07 15:33:49 UTC
  • mfrom: (1.3.12)
  • Revision ID: package-import@ubuntu.com-20131107153349-e31sc149l2szs3jb
Tags: 1.6-1
* New upstream version. Closes: #557474, #724637.
* python-django now also suggests the installation of ipython,
  bpython, python-django-doc, and libgdal1.
  Closes: #636511, #686333, #704203
* Set package maintainer to Debian Python Modules Team.
* Bump standards version to 3.9.5, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import re
 
2
 
 
3
from django import get_version
 
4
from django.utils import six
 
5
from django.utils.unittest import TestCase
 
6
 
 
7
class VersionTests(TestCase):
 
8
 
 
9
    def test_development(self):
 
10
        ver_tuple = (1, 4, 0, 'alpha', 0)
 
11
        # This will return a different result when it's run within or outside
 
12
        # of a git clone: 1.4.devYYYYMMDDHHMMSS or 1.4.
 
13
        ver_string = get_version(ver_tuple)
 
14
        six.assertRegex(self, ver_string, r'1\.4(\.dev\d+)?')
 
15
 
 
16
    def test_releases(self):
 
17
        tuples_to_strings = (
 
18
            ((1, 4, 0, 'alpha', 1), '1.4a1'),
 
19
            ((1, 4, 0, 'beta', 1), '1.4b1'),
 
20
            ((1, 4, 0, 'rc', 1), '1.4c1'),
 
21
            ((1, 4, 0, 'final', 0), '1.4'),
 
22
            ((1, 4, 1, 'rc', 2), '1.4.1c2'),
 
23
            ((1, 4, 1, 'final', 0), '1.4.1'),
 
24
        )
 
25
        for ver_tuple, ver_string in tuples_to_strings:
 
26
            self.assertEqual(get_version(ver_tuple), ver_string)
 
27