Fix: 'stats reset' command fails with AttributeError

delete_stats() returns count_per_model from
self.stats_model.objects.all().delete(). Keys of that dict are set to
model._meta.label in Collector.delete() (called by QuerySet.delete()).

Further, add a matching test case.

Issue: HIC-151
Change-Id: I96838820cb7f8fd7f32825acc1cb52845484bb6a
diff --git a/crashreport_stats/management/commands/stats.py b/crashreport_stats/management/commands/stats.py
index 2852d46..5ac2dea 100644
--- a/crashreport_stats/management/commands/stats.py
+++ b/crashreport_stats/management/commands/stats.py
@@ -422,11 +422,12 @@
                     # Default the count of deleted models to 0 if missing
                     if not counts_per_model:
                         counts_per_model = {
-                            engine.stats_model: 0,
-                            engine.daily_stats_model: 0}
+                            engine.stats_model._meta.label: 0,
+                            engine.daily_stats_model._meta.label: 0}
                     for model, count in counts_per_model.items():
+                        name = model.split('.')[-1]
                         self._success(
-                            '{} {} deleted'.format(count, model.__name__))
+                            '{} {} deleted'.format(count, name))
 
             # Reset the metadata
             count, _ = StatsMetadata.objects.all().delete()