Merge lp:~michael.nelson/ubuntu-webcatalog/1267731-import-sca-apps-error into lp:ubuntu-webcatalog
- 1267731-import-sca-apps-error
- Merge into trunk
Proposed by
Michael Nelson
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Michael Nelson | ||||
Approved revision: | 199 | ||||
Merged at revision: | 196 | ||||
Proposed branch: | lp:~michael.nelson/ubuntu-webcatalog/1267731-import-sca-apps-error | ||||
Merge into: | lp:ubuntu-webcatalog | ||||
Diff against target: |
254 lines (+191/-3) 5 files modified
src/webcatalog/forms.py (+1/-1) src/webcatalog/management/commands/import_sca_apps.py (+6/-1) src/webcatalog/migrations/0030_application_debtags_to_textfield.py (+174/-0) src/webcatalog/models/applications.py (+1/-1) src/webcatalog/tests/test_commands.py (+9/-0) |
||||
To merge this branch: | bzr merge lp:~michael.nelson/ubuntu-webcatalog/1267731-import-sca-apps-error | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Albisetti (community) | Approve | ||
Review via email: mp+201146@code.launchpad.net |
Commit message
Don't error on bad/unexpected import data.
Enable debtags field to be > 255.
Description of the change
Fixes bug 1267731 by:
1) Ensuring we don't error if one sca app happens to have unexpected data, instead logging the error
2) Enabling the debtags field to be > 255
To post a comment you must log in.
Revision history for this message
Martin Albisetti (beuno) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/webcatalog/forms.py' | |||
2 | --- src/webcatalog/forms.py 2013-05-21 12:24:28 +0000 | |||
3 | +++ src/webcatalog/forms.py 2014-01-10 09:19:06 +0000 | |||
4 | @@ -161,7 +161,7 @@ | |||
5 | 161 | 161 | ||
6 | 162 | try: | 162 | try: |
7 | 163 | instance = Application.objects.get( | 163 | instance = Application.objects.get( |
9 | 164 | package_name=app_data['package_name'], | 164 | package_name=app_data.get('package_name'), |
10 | 165 | distroseries=distroseries) | 165 | distroseries=distroseries) |
11 | 166 | except Application.DoesNotExist: | 166 | except Application.DoesNotExist: |
12 | 167 | instance = None | 167 | instance = None |
13 | 168 | 168 | ||
14 | === modified file 'src/webcatalog/management/commands/import_sca_apps.py' | |||
15 | --- src/webcatalog/management/commands/import_sca_apps.py 2013-09-03 08:45:45 +0000 | |||
16 | +++ src/webcatalog/management/commands/import_sca_apps.py 2014-01-10 09:19:06 +0000 | |||
17 | @@ -123,12 +123,17 @@ | |||
18 | 123 | def import_app_from_data(self, app_data, icon_data, distroseries): | 123 | def import_app_from_data(self, app_data, icon_data, distroseries): |
19 | 124 | form = SCAApplicationForm.from_api_data( | 124 | form = SCAApplicationForm.from_api_data( |
20 | 125 | app_data, distroseries) | 125 | app_data, distroseries) |
21 | 126 | package_name = None | ||
22 | 126 | if form.is_valid(): | 127 | if form.is_valid(): |
23 | 127 | app = form.save() | 128 | app = form.save() |
24 | 128 | department_names = app_data.get('department', []) | 129 | department_names = app_data.get('department', []) |
25 | 129 | app.update_departments(department_names) | 130 | app.update_departments(department_names) |
26 | 131 | package_name = app.package_name | ||
27 | 130 | self.add_icon_to_app(app, data=icon_data) | 132 | self.add_icon_to_app(app, data=icon_data) |
29 | 131 | return app.package_name | 133 | else: |
30 | 134 | logger.error("An SCA app failed to import. Errors: %s", | ||
31 | 135 | form.errors) | ||
32 | 136 | return package_name | ||
33 | 132 | 137 | ||
34 | 133 | def get_icon_data(self, app_data): | 138 | def get_icon_data(self, app_data): |
35 | 134 | icon_data = app_data.get('icon_data', '') | 139 | icon_data = app_data.get('icon_data', '') |
36 | 135 | 140 | ||
37 | === added file 'src/webcatalog/migrations/0030_application_debtags_to_textfield.py' | |||
38 | --- src/webcatalog/migrations/0030_application_debtags_to_textfield.py 1970-01-01 00:00:00 +0000 | |||
39 | +++ src/webcatalog/migrations/0030_application_debtags_to_textfield.py 2014-01-10 09:19:06 +0000 | |||
40 | @@ -0,0 +1,174 @@ | |||
41 | 1 | # -*- coding: utf-8 -*- | ||
42 | 2 | import datetime | ||
43 | 3 | from south.db import db | ||
44 | 4 | from south.v2 import SchemaMigration | ||
45 | 5 | from django.db import models | ||
46 | 6 | |||
47 | 7 | |||
48 | 8 | class Migration(SchemaMigration): | ||
49 | 9 | |||
50 | 10 | def forwards(self, orm): | ||
51 | 11 | |||
52 | 12 | # Changing field 'Application.debtags' | ||
53 | 13 | db.alter_column(u'webcatalog_application', 'debtags', self.gf('django.db.models.fields.TextField')()) | ||
54 | 14 | |||
55 | 15 | def backwards(self, orm): | ||
56 | 16 | |||
57 | 17 | # Changing field 'Application.debtags' | ||
58 | 18 | db.alter_column(u'webcatalog_application', 'debtags', self.gf('django.db.models.fields.CharField')(max_length=255)) | ||
59 | 19 | |||
60 | 20 | models = { | ||
61 | 21 | u'auth.group': { | ||
62 | 22 | 'Meta': {'object_name': 'Group'}, | ||
63 | 23 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
64 | 24 | 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), | ||
65 | 25 | 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) | ||
66 | 26 | }, | ||
67 | 27 | u'auth.permission': { | ||
68 | 28 | 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, | ||
69 | 29 | 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
70 | 30 | 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), | ||
71 | 31 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
72 | 32 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) | ||
73 | 33 | }, | ||
74 | 34 | u'auth.user': { | ||
75 | 35 | 'Meta': {'object_name': 'User'}, | ||
76 | 36 | 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | ||
77 | 37 | 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), | ||
78 | 38 | 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), | ||
79 | 39 | 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), | ||
80 | 40 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
81 | 41 | 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), | ||
82 | 42 | 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
83 | 43 | 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
84 | 44 | 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | ||
85 | 45 | 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), | ||
86 | 46 | 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), | ||
87 | 47 | 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), | ||
88 | 48 | 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) | ||
89 | 49 | }, | ||
90 | 50 | u'contenttypes.contenttype': { | ||
91 | 51 | 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, | ||
92 | 52 | 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
93 | 53 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
94 | 54 | 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
95 | 55 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) | ||
96 | 56 | }, | ||
97 | 57 | 'webcatalog.application': { | ||
98 | 58 | 'Meta': {'ordering': "('-wilson_score', 'name')", 'unique_together': "(('distroseries', 'package_name'),)", 'object_name': 'Application'}, | ||
99 | 59 | 'app_type': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), | ||
100 | 60 | 'architectures': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), | ||
101 | 61 | 'archive_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'null': 'True', 'blank': 'True'}), | ||
102 | 62 | 'categories': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), | ||
103 | 63 | 'channel': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), | ||
104 | 64 | 'comment': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), | ||
105 | 65 | 'debtags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), | ||
106 | 66 | 'departments': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['webcatalog.Department']", 'symmetrical': 'False', 'blank': 'True'}), | ||
107 | 67 | 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), | ||
108 | 68 | 'distroseries': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['webcatalog.DistroSeries']"}), | ||
109 | 69 | 'icon': ('django.db.models.fields.files.ImageField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), | ||
110 | 70 | 'icon_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), | ||
111 | 71 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
112 | 72 | 'imported_from_sca': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
113 | 73 | 'is_latest': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
114 | 74 | 'keywords': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), | ||
115 | 75 | 'license': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), | ||
116 | 76 | 'mimetype': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'blank': 'True'}), | ||
117 | 77 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
118 | 78 | 'package_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
119 | 79 | 'popcon': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), | ||
120 | 80 | 'price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '7', 'decimal_places': '2', 'blank': 'True'}), | ||
121 | 81 | 'ratings_average': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '3', 'decimal_places': '2', 'blank': 'True'}), | ||
122 | 82 | 'ratings_histogram': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), | ||
123 | 83 | 'ratings_total': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), | ||
124 | 84 | 'section': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), | ||
125 | 85 | 'version': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), | ||
126 | 86 | 'wilson_score': ('django.db.models.fields.FloatField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) | ||
127 | 87 | }, | ||
128 | 88 | 'webcatalog.applicationmedia': { | ||
129 | 89 | 'Meta': {'ordering': "('url',)", 'unique_together': "(('application', 'url'),)", 'object_name': 'ApplicationMedia'}, | ||
130 | 90 | 'application': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['webcatalog.Application']"}), | ||
131 | 91 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
132 | 92 | 'media_type': ('django.db.models.fields.CharField', [], {'max_length': '16'}), | ||
133 | 93 | 'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}) | ||
134 | 94 | }, | ||
135 | 95 | 'webcatalog.applicationwidget': { | ||
136 | 96 | 'Meta': {'object_name': 'ApplicationWidget'}, | ||
137 | 97 | 'applications': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['webcatalog.Application']", 'symmetrical': 'False'}), | ||
138 | 98 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
139 | 99 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '32'}), | ||
140 | 100 | 'template_snippet': ('django.db.models.fields.TextField', [], {}) | ||
141 | 101 | }, | ||
142 | 102 | 'webcatalog.consumer': { | ||
143 | 103 | 'Meta': {'object_name': 'Consumer'}, | ||
144 | 104 | 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), | ||
145 | 105 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
146 | 106 | 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), | ||
147 | 107 | 'secret': ('django.db.models.fields.CharField', [], {'default': "'eOaKTZKZvdBXcmqOogpjVgwahoZiCG'", 'max_length': '255', 'blank': 'True'}), | ||
148 | 108 | 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), | ||
149 | 109 | 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'oauth_consumer'", 'unique': 'True', 'to': u"orm['auth.User']"}) | ||
150 | 110 | }, | ||
151 | 111 | 'webcatalog.department': { | ||
152 | 112 | 'Meta': {'object_name': 'Department'}, | ||
153 | 113 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
154 | 114 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}), | ||
155 | 115 | 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['webcatalog.Department']", 'null': 'True', 'blank': 'True'}), | ||
156 | 116 | 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}) | ||
157 | 117 | }, | ||
158 | 118 | 'webcatalog.distroseries': { | ||
159 | 119 | 'Meta': {'object_name': 'DistroSeries'}, | ||
160 | 120 | 'code_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), | ||
161 | 121 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
162 | 122 | 'prerelease': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
163 | 123 | 'version': ('django.db.models.fields.CharField', [], {'max_length': '10', 'blank': 'True'}) | ||
164 | 124 | }, | ||
165 | 125 | 'webcatalog.exhibit': { | ||
166 | 126 | 'Meta': {'object_name': 'Exhibit'}, | ||
167 | 127 | 'banner_url': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), | ||
168 | 128 | 'click_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200'}), | ||
169 | 129 | 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), | ||
170 | 130 | 'display': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), | ||
171 | 131 | 'distroseries': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['webcatalog.DistroSeries']", 'symmetrical': 'False'}), | ||
172 | 132 | 'html': ('django.db.models.fields.TextField', [], {}), | ||
173 | 133 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
174 | 134 | 'package_names': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), | ||
175 | 135 | 'published': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
176 | 136 | 'sca_id': ('django.db.models.fields.IntegerField', [], {}), | ||
177 | 137 | 'weight': ('django.db.models.fields.IntegerField', [], {'default': '0'}) | ||
178 | 138 | }, | ||
179 | 139 | 'webcatalog.machine': { | ||
180 | 140 | 'Meta': {'unique_together': "(('owner', 'uuid'),)", 'object_name': 'Machine'}, | ||
181 | 141 | 'hostname': ('django.db.models.fields.CharField', [], {'max_length': '64'}), | ||
182 | 142 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
183 | 143 | 'logo_checksum': ('django.db.models.fields.CharField', [], {'max_length': '56', 'blank': 'True'}), | ||
184 | 144 | 'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), | ||
185 | 145 | 'package_list': ('django.db.models.fields.TextField', [], {}), | ||
186 | 146 | 'packages_checksum': ('django.db.models.fields.CharField', [], {'max_length': '56'}), | ||
187 | 147 | 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}) | ||
188 | 148 | }, | ||
189 | 149 | 'webcatalog.nonce': { | ||
190 | 150 | 'Meta': {'unique_together': "(('nonce', 'token', 'consumer'),)", 'object_name': 'Nonce'}, | ||
191 | 151 | 'consumer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['webcatalog.Consumer']"}), | ||
192 | 152 | 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), | ||
193 | 153 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
194 | 154 | 'nonce': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
195 | 155 | 'token': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['webcatalog.Token']"}) | ||
196 | 156 | }, | ||
197 | 157 | 'webcatalog.reviewstatsimport': { | ||
198 | 158 | 'Meta': {'object_name': 'ReviewStatsImport'}, | ||
199 | 159 | 'distroseries': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['webcatalog.DistroSeries']", 'unique': 'True'}), | ||
200 | 160 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
201 | 161 | 'last_import': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.utcnow'}) | ||
202 | 162 | }, | ||
203 | 163 | 'webcatalog.token': { | ||
204 | 164 | 'Meta': {'object_name': 'Token'}, | ||
205 | 165 | 'consumer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['webcatalog.Consumer']"}), | ||
206 | 166 | 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), | ||
207 | 167 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), | ||
208 | 168 | 'token': ('django.db.models.fields.CharField', [], {'default': "'KuCuRllKERFEWvVDGwtGZVBScLCUayQJucTDuMnjJopJEmcPie'", 'max_length': '50', 'primary_key': 'True'}), | ||
209 | 169 | 'token_secret': ('django.db.models.fields.CharField', [], {'default': "'odbGcySxXFGCRbSnhOIoicNWCkMTUGPUcyVbRDkDPptJrNRHba'", 'max_length': '50'}), | ||
210 | 170 | 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) | ||
211 | 171 | } | ||
212 | 172 | } | ||
213 | 173 | |||
214 | 174 | complete_apps = ['webcatalog'] | ||
215 | 0 | \ No newline at end of file | 175 | \ No newline at end of file |
216 | 1 | 176 | ||
217 | === modified file 'src/webcatalog/models/applications.py' | |||
218 | --- src/webcatalog/models/applications.py 2013-04-23 10:18:41 +0000 | |||
219 | +++ src/webcatalog/models/applications.py 2014-01-10 09:19:06 +0000 | |||
220 | @@ -104,7 +104,7 @@ | |||
221 | 104 | ratings_histogram = models.CharField(max_length=128, blank=True) | 104 | ratings_histogram = models.CharField(max_length=128, blank=True) |
222 | 105 | is_latest = models.BooleanField() | 105 | is_latest = models.BooleanField() |
223 | 106 | wilson_score = models.FloatField(null=True, blank=True, db_index=True) | 106 | wilson_score = models.FloatField(null=True, blank=True, db_index=True) |
225 | 107 | debtags = models.CharField(max_length=255, blank=True) | 107 | debtags = models.TextField(blank=True) |
226 | 108 | license = models.CharField( | 108 | license = models.CharField( |
227 | 109 | max_length=64, blank=True, | 109 | max_length=64, blank=True, |
228 | 110 | help_text=u"The name of the license used for the app.") | 110 | help_text=u"The name of the license used for the app.") |
229 | 111 | 111 | ||
230 | === modified file 'src/webcatalog/tests/test_commands.py' | |||
231 | --- src/webcatalog/tests/test_commands.py 2013-04-10 07:57:06 +0000 | |||
232 | +++ src/webcatalog/tests/test_commands.py 2014-01-10 09:19:06 +0000 | |||
233 | @@ -57,6 +57,7 @@ | |||
234 | 57 | from webcatalog.management.commands import ( | 57 | from webcatalog.management.commands import ( |
235 | 58 | import_app_install_data, | 58 | import_app_install_data, |
236 | 59 | import_ratings_stats, | 59 | import_ratings_stats, |
237 | 60 | import_sca_apps, | ||
238 | 60 | ) | 61 | ) |
239 | 61 | from webcatalog.tests.factory import ( | 62 | from webcatalog.tests.factory import ( |
240 | 62 | TestCaseWithFactory, | 63 | TestCaseWithFactory, |
241 | @@ -731,6 +732,14 @@ | |||
242 | 731 | self.assertEqual('natty', | 732 | self.assertEqual('natty', |
243 | 732 | remaining_hello_apps[0].distroseries.code_name) | 733 | remaining_hello_apps[0].distroseries.code_name) |
244 | 733 | 734 | ||
245 | 735 | def test_import_app_from_data_returns_none(self): | ||
246 | 736 | command = import_sca_apps.Command() | ||
247 | 737 | precise = self.factory.make_distroseries(code_name='precise') | ||
248 | 738 | |||
249 | 739 | result = command.import_app_from_data({}, {}, precise) | ||
250 | 740 | |||
251 | 741 | self.assertIsNone(result) | ||
252 | 742 | |||
253 | 734 | 743 | ||
254 | 735 | class ImportRatingsTestCase(TestCaseWithFactory): | 744 | class ImportRatingsTestCase(TestCaseWithFactory): |
255 | 736 | 745 |