コード例 #1
0
ファイル: tests.py プロジェクト: misli/fedora-software
 def create_sample_featured_app(self, component):
     """
     Helper method created in order to populate the table
     'FeaturedApp'
     """
     sample_featured_app = FeaturedApp()
     sample_featured_app.component = component
     sample_featured_app.save()
     return sample_featured_app
コード例 #2
0
 def create_sample_featured_app(self, component):
     """
     Helper method created in order to populate the table
     'FeaturedApp'
     """
     sample_featured_app = FeaturedApp()
     sample_featured_app.component = component
     sample_featured_app.save()
     return sample_featured_app
コード例 #3
0
    def test_create_featured_app(self):
        """
        Tests the creation of a FeaturedApp
        """
        sample_component = self.create_sample_component(
            type_id="firefox.desktop")
        first_featured_app = FeaturedApp()
        first_featured_app.component = sample_component
        first_featured_app.save()

        sample_component = self.create_sample_component(
            type_id="ardour.desktop")
        second_featured_app = FeaturedApp()
        second_featured_app.component = sample_component
        second_featured_app.save()

        saved_featured_apps = FeaturedApp.objects.all()
        self.assertEqual(saved_featured_apps.count(), 2)
コード例 #4
0
ファイル: tests.py プロジェクト: misli/fedora-software
    def test_create_featured_app(self):
        """
        Tests the creation of a FeaturedApp
        """
        sample_component =self.create_sample_component(
                type_id="firefox.desktop"
                )
        first_featured_app = FeaturedApp()
        first_featured_app.component = sample_component
        first_featured_app.save()

        sample_component = self.create_sample_component(
                type_id="ardour.desktop"
                )
        second_featured_app = FeaturedApp()
        second_featured_app.component = sample_component
        second_featured_app.save()

        saved_featured_apps = FeaturedApp.objects.all()
        self.assertEqual(saved_featured_apps.count(), 2)