def test_display_default(self): app = ContainerApp(name='') # default app app.container = Container(tag='v1.0') app.container.family = ContainerFamily(name='Splines') expected_display_name = 'Splines:v1.0' display_name = app.display_name self.assertEqual(expected_display_name, display_name)
def test_display_default(self): app = ContainerApp(name='') # default app app.container = Container(tag='v1.0') app.container.family = ContainerFamily(name='Splines') expected_display_name = 'Splines:v1.0' display_name = app.display_name self.assertEqual(expected_display_name, display_name)
def test_display_name(self): app = ContainerApp(name='reticulate') app.container = Container(tag='v1.0') app.container.family = ContainerFamily(name='Splines') expected_display_name = 'Splines:v1.0 / reticulate' display_name = app.display_name app_str = str(app) self.assertEqual(expected_display_name, display_name) self.assertEqual(expected_display_name, app_str)
def test_display_name(self): app = ContainerApp(name='reticulate') app.container = Container(tag='v1.0') app.container.family = ContainerFamily(name='Splines') expected_display_name = 'Splines:v1.0 / reticulate' display_name = app.display_name app_str = str(app) self.assertEqual(expected_display_name, display_name) self.assertEqual(expected_display_name, app_str)
def setUp(self): self.mock_viewset(ContainerAppViewSet) super(ContainerAppApiMockTests, self).setUp() patcher = mocked_relations(Container, ContainerFamily) patcher.start() self.addCleanup(patcher.stop) self.list_path = reverse("containerapp-list") self.list_view, _, _ = resolve(self.list_path) self.detail_pk = 43 self.detail_path = reverse("containerapp-detail", kwargs={'pk': self.detail_pk}) self.detail_view, _, _ = resolve(self.detail_path) self.my_user = User(pk=1000) User.objects.add(self.my_user) my_kive_user = KiveUser(pk=self.my_user.pk, username='******') KiveUser.objects.add(my_kive_user) other_user = User(pk=1001) User.objects.add(other_user) other_kive_user = KiveUser(pk=other_user.pk) KiveUser.objects.add(other_kive_user) my_container = Container.objects.create(id=100, user=my_kive_user) my_container.family = ContainerFamily.objects.create() other_container = Container.objects.create(id=101, user=other_kive_user) archive = ContainerApp(pk=42, name='archive', description='impressive') compress = ContainerApp(pk=43, name='compress') backup = ContainerApp(pk=44, name='backup') distribute = ContainerApp(pk=45, name='distribute') archive.container = compress.container = backup.container = my_container distribute.container = other_container ContainerApp.objects.add(archive, compress, backup, distribute)
def setUp(self): self.mock_viewset(ContainerAppViewSet) super(ContainerAppApiMockTests, self).setUp() patcher = mocked_relations(Container, ContainerFamily) patcher.start() self.addCleanup(patcher.stop) self.list_path = reverse("containerapp-list") self.list_view, _, _ = resolve(self.list_path) self.detail_pk = 43 self.detail_path = reverse("containerapp-detail", kwargs={'pk': self.detail_pk}) self.detail_view, _, _ = resolve(self.detail_path) self.my_user = User(pk=1000) User.objects.add(self.my_user) my_kive_user = KiveUser(pk=self.my_user.pk, username='******') KiveUser.objects.add(my_kive_user) other_user = User(pk=1001) User.objects.add(other_user) other_kive_user = KiveUser(pk=other_user.pk) KiveUser.objects.add(other_kive_user) my_container = Container.objects.create(id=100, user=my_kive_user) my_container.family = ContainerFamily.objects.create() other_container = Container.objects.create(id=101, user=other_kive_user) archive = ContainerApp(pk=42, name='archive', description='impressive') compress = ContainerApp(pk=43, name='compress') backup = ContainerApp(pk=44, name='backup') distribute = ContainerApp(pk=45, name='distribute') archive.container = compress.container = backup.container = my_container distribute.container = other_container ContainerApp.objects.add(archive, compress, backup, distribute)