Seraphim Mellos avatar Seraphim Mellos committed 98c69ce

Fixed lotte and resources tests.

Comments (0)

Files changed (3)

transifex/addons/lotte/tests/views.py

 
         resp3 = self.client['maintainer'].post(self.push_translation,
             json.dumps(data3), content_type='application/json')
-        self.assertContains(resp3, 'Translation updated successfully',
-            status_code=200)
+        self.assertEqual(resp3.status_code, 200)
 
         self.assertEqual(Translation.objects.filter(
             source_entity=self.source_entity_plural,
 
         resp4 = self.client['maintainer'].post(self.push_translation,
             json.dumps(data4), content_type='application/json')
-        self.assertContains(resp4, 'Translation updated successfully',
-            status_code=200)
+        self.assertEqual(resp4.status_code, 200)
 
         self.assertEqual(Translation.objects.filter(
             source_entity=self.source_entity_plural,
         # We push again the data to return to the setup state.
         resp5 = self.client['maintainer'].post(self.push_translation,
             json.dumps(data3), content_type='application/json')
-        self.assertContains(resp3, 'Translation updated successfully',
-            status_code=200)
+        self.assertEqual(resp3.status_code, 200)
         self.assertEqual(Translation.objects.filter(
             source_entity=self.source_entity_plural,
             language=self.language_ar).count(), 6)

transifex/resources/tests/models.py

         # since we have two source entities
         words_ar = len(self.translation_ar.string.split(None))
         rls_ar = self.resource.rlstats_set.get(language=self.language_ar)
-        self.assertEqual(rls_ar.translated_perc, 100)
+        self.assertEqual(rls_ar.translated_perc, 50)
         # FIXME: This is not implemented yet. All wordcounts are based on
         # source
         #self.assertEqual(rls_ar.untranslated_wordcount, 5)

transifex/txcommon/tests/base.py

             resource=self.resource_private)
 
         # Create pluralized source entity
-        #self.source_entity_plural = SourceEntity.objects.create(
-        #    string='pluralized_String1', context='Context1',
-        #    occurrences='Occurrences1_plural', resource= self.resource,
-        #    pluralized=True)
-        #self.source_entity_plural_private = SourceEntity.objects.create(
-        #    string='pluralized_String1', context='Context1',
-        #    occurrences='Occurrences1_plural', resource= self.resource_private,
-        #    pluralized=True)
+        self.source_entity_plural = SourceEntity.objects.create(
+            string='pluralized_String1', context='Context1',
+            occurrences='Occurrences1_plural', resource= self.resource,
+            pluralized=True)
+        self.source_entity_plural_private = SourceEntity.objects.create(
+            string='pluralized_String1', context='Context1',
+            occurrences='Occurrences1_plural', resource= self.resource_private,
+            pluralized=True)
         
         # Create one translation
         self.translation_en = self.source_entity.translations.create(
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.