create system user when creating a new hosting package
This commit is contained in:
parent
d4f68a155c
commit
888a2463c4
6 changed files with 110 additions and 10 deletions
0
gnuviechadmin/hostingpackages/tests/__init__.py
Normal file
0
gnuviechadmin/hostingpackages/tests/__init__.py
Normal file
31
gnuviechadmin/hostingpackages/tests/test_models.py
Normal file
31
gnuviechadmin/hostingpackages/tests/test_models.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
"""
|
||||
Test for models.
|
||||
|
||||
"""
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from hostingpackages.models import (
|
||||
DISK_SPACE_UNITS,
|
||||
CustomerHostingPackage,
|
||||
)
|
||||
|
||||
|
||||
class CustomerHostingPackageTest(TestCase):
|
||||
def test_get_disk_space_bytes(self):
|
||||
package = CustomerHostingPackage(
|
||||
diskspace=10, diskspace_unit=DISK_SPACE_UNITS.G
|
||||
)
|
||||
self.assertEqual(package.get_disk_space(), 10 * 1024 * 1024**2)
|
||||
|
||||
def test_get_disk_space_mib(self):
|
||||
package = CustomerHostingPackage(
|
||||
diskspace=10, diskspace_unit=DISK_SPACE_UNITS.G
|
||||
)
|
||||
self.assertEqual(package.get_disk_space(DISK_SPACE_UNITS.M), 10 * 1024)
|
||||
|
||||
def test_get_quota(self):
|
||||
package = CustomerHostingPackage(
|
||||
diskspace=256, diskspace_unit=DISK_SPACE_UNITS.M
|
||||
)
|
||||
self.assertEqual(package.get_quota(), (262144, 275251))
|
Loading…
Add table
Add a link
Reference in a new issue